| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |