OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 'use strict'; |
| 6 |
| 7 /** |
| 8 * This class is the dummy class which has same interface as VideoElement. This |
| 9 * behaves like VideoElement, and is used for making Chromecast player |
| 10 * controlled instead of the true Video Element tag. |
| 11 * |
| 12 * @constructor |
| 13 */ |
| 14 function CastVideoElement() { |
| 15 this.duration_ = null; |
| 16 this.currentTime_ = null; |
| 17 this.src_ = ''; |
| 18 this.volume_ = 100; |
| 19 } |
| 20 |
| 21 CastVideoElement.prototype = { |
| 22 __proto__: cr.EventTarget.prototype, |
| 23 |
| 24 /** |
| 25 * Returns a parent node. This must always be null. |
| 26 * @return {Element} |
| 27 */ |
| 28 get parentNode() { |
| 29 return null; |
| 30 }, |
| 31 |
| 32 /** |
| 33 * The total time of the video. |
| 34 * @type {number} |
| 35 */ |
| 36 get duration() { |
| 37 return this.duration_; |
| 38 }, |
| 39 |
| 40 /** |
| 41 * The current timestamp of the video. |
| 42 * @type {number} |
| 43 */ |
| 44 get currentTime() { |
| 45 return this.currentTime_; |
| 46 }, |
| 47 set currentTime(currentTime) { |
| 48 this.currentTime_ = currentTime; |
| 49 }, |
| 50 |
| 51 /** |
| 52 * If this video is pauses or not. |
| 53 * @type {boolean} |
| 54 */ |
| 55 get paused() { |
| 56 return false; |
| 57 }, |
| 58 |
| 59 /** |
| 60 * If this video is ended or not. |
| 61 * @type {boolean} |
| 62 */ |
| 63 get ended() { |
| 64 return false; |
| 65 }, |
| 66 |
| 67 /** |
| 68 * If this video is seelable or not. |
| 69 * @type {boolean} |
| 70 */ |
| 71 get seekable() { |
| 72 return false; |
| 73 }, |
| 74 |
| 75 /** |
| 76 * Value of the volume |
| 77 * @type {number} |
| 78 */ |
| 79 get volume() { |
| 80 return this.volume_; |
| 81 }, |
| 82 set volume(volume) { |
| 83 this.volume_ = volume; |
| 84 }, |
| 85 |
| 86 /** |
| 87 * Returns the source of the current video. |
| 88 * @return {string} |
| 89 */ |
| 90 get src() { |
| 91 return this.src_; |
| 92 }, |
| 93 |
| 94 /** |
| 95 * Plays the video. |
| 96 */ |
| 97 play: function() { |
| 98 // TODO(yoshiki): Implement this. |
| 99 }, |
| 100 |
| 101 /** |
| 102 * Pauses the video. |
| 103 */ |
| 104 pause: function() { |
| 105 // TODO(yoshiki): Implement this. |
| 106 }, |
| 107 |
| 108 /** |
| 109 * Loads the video. |
| 110 */ |
| 111 load: function() { |
| 112 // TODO(yoshiki): Implement this. |
| 113 }, |
| 114 }; |
OLD | NEW |