| Index: ui/file_manager/video_player/js/cast/cast_video_element.js
|
| diff --git a/ui/file_manager/video_player/js/cast/cast_video_element.js b/ui/file_manager/video_player/js/cast/cast_video_element.js
|
| index d61396494257871783b63e6b36429d79415c1fe5..ccbc342f5dbb6f133fe92d3e5dff1b3d881ffd3e 100644
|
| --- a/ui/file_manager/video_player/js/cast/cast_video_element.js
|
| +++ b/ui/file_manager/video_player/js/cast/cast_video_element.js
|
| @@ -36,6 +36,7 @@ function CastVideoElement(media, session) {
|
| this.currentTime_ = null;
|
| this.src_ = '';
|
| this.volume_ = 100;
|
| + this.loop_ = false;
|
| this.currentMediaPlayerState_ = null;
|
| this.currentMediaCurrentTime_ = null;
|
| this.currentMediaDuration_ = null;
|
| @@ -193,6 +194,17 @@ CastVideoElement.prototype = {
|
| },
|
|
|
| /**
|
| + * Returns the flag if the video loops at end or not.
|
| + * @type {boolean}
|
| + */
|
| + get loop() {
|
| + return this.loop_;
|
| + },
|
| + set loop(value) {
|
| + this.loop_ = !!value;
|
| + },
|
| +
|
| + /**
|
| * Returns the error object if available.
|
| * @type {?Object}
|
| */
|
| @@ -408,6 +420,21 @@ CastVideoElement.prototype = {
|
| return;
|
|
|
| var media = this.castMedia_;
|
| + if (this.loop_ &&
|
| + media.idleReason === chrome.cast.media.IdleReason.FINISHED &&
|
| + !alive) {
|
| + // Resets the previous media silently.
|
| + this.castMedia_ = null;
|
| +
|
| + // Replay the current media.
|
| + this.currentMediaPlayerState_ = chrome.cast.media.PlayerState.BUFFERING;
|
| + this.currentMediaCurrentTime_ = 0;
|
| + this.dispatchEvent(new Event('play'));
|
| + this.dispatchEvent(new Event('timeupdate'));
|
| + this.play();
|
| + return;
|
| + }
|
| +
|
| if (this.currentMediaPlayerState_ !== media.playerState) {
|
| var oldPlayState = false;
|
| var oldState = this.currentMediaPlayerState_;
|
|
|