Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: ui/file_manager/video_player/js/cast/cast_video_element.js

Issue 517963002: Video Player: Fix the condition of 'ended' property (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 'use strict'; 5 'use strict';
6 6
7 /** 7 /**
8 * Interval for updating media info (in ms). 8 * Interval for updating media info (in ms).
9 * @type {number} 9 * @type {number}
10 * @const 10 * @const
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 }, 112 },
113 113
114 /** 114 /**
115 * If this video is ended or not. 115 * If this video is ended or not.
116 * @type {boolean} 116 * @type {boolean}
117 */ 117 */
118 get ended() { 118 get ended() {
119 if (!this.castMedia_) 119 if (!this.castMedia_)
120 return true; 120 return true;
121 121
122 return this.castMedia_.idleReason === chrome.cast.media.IdleReason.FINISHED; 122 return !this.playInProgress &&
123 this.castMedia_.idleReason === chrome.cast.media.IdleReason.FINISHED;
123 }, 124 },
124 125
125 /** 126 /**
126 * TimeRange object that represents the seekable ranges of the media 127 * TimeRange object that represents the seekable ranges of the media
127 * resource. 128 * resource.
128 * @type {TimeRanges} 129 * @type {TimeRanges}
129 */ 130 */
130 get seekable() { 131 get seekable() {
131 return { 132 return {
132 length: 1, 133 length: 1,
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 this.dispatchEvent(new Event('durationchange')); 416 this.dispatchEvent(new Event('durationchange'));
416 } 417 }
417 418
418 // Media is being unloaded. 419 // Media is being unloaded.
419 if (!alive) { 420 if (!alive) {
420 this.unloadMedia_(); 421 this.unloadMedia_();
421 return; 422 return;
422 } 423 }
423 }, 424 },
424 }; 425 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698