Commit eacfb1e9 authored by yoshiki's avatar yoshiki Committed by Commit bot

Video Player: Resume the playback position on launch

Before, the specified playback position was ignored so this patch fixes the bug.

BUG=395868

Review URL: https://codereview.chromium.org/556493002

Cr-Commit-Position: refs/heads/master@{#294350}
parent fc16325b
...@@ -198,13 +198,15 @@ AudioPlayer.prototype.onUnload = function() { ...@@ -198,13 +198,15 @@ AudioPlayer.prototype.onUnload = function() {
/** /**
* Selects a new track to play. * Selects a new track to play.
* @param {number} newTrack New track number. * @param {number} newTrack New track number.
* @param {number} time New playback position (in second).
* @private * @private
*/ */
AudioPlayer.prototype.select_ = function(newTrack) { AudioPlayer.prototype.select_ = function(newTrack, time) {
if (this.currentTrackIndex_ == newTrack) return; if (this.currentTrackIndex_ == newTrack) return;
this.currentTrackIndex_ = newTrack; this.currentTrackIndex_ = newTrack;
this.player_.currentTrackIndex = this.currentTrackIndex_; this.player_.currentTrackIndex = this.currentTrackIndex_;
this.player_.audioController.time = time;
Platform.performMicrotaskCheckpoint(); Platform.performMicrotaskCheckpoint();
if (!window.appReopen) if (!window.appReopen)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment