Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..6259e2d74dca26fe6ed0030fdcd0ef7f15eb6cf1 |
| --- /dev/null |
| +++ b/ui/file_manager/video_player/js/cast/cast_video_element.js |
| @@ -0,0 +1,112 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +'use strict'; |
| + |
| +/** |
| + * This class is dummy class which has same interface as VideoElement. This |
| + * behaves like VideoElementand <video>) uses for making Chromecast player |
|
fukino
2014/07/18 10:18:43
Comment broken?
yoshiki
2014/07/18 15:56:34
Thanks for notifying.
|
| + * controlled instead of true <video> tag. |
| + */ |
| +function CastVideoElement() { |
| + this.duration_ = null; |
| + this.currentTime_ = null; |
| + this.src_ = ''; |
| + this.volume_ = 100; |
| +} |
| + |
| +CastVideoElement.prototype = { |
| + __proto__: cr.EventTarget.prototype, |
| + |
| + /** |
| + * Returns a parent node. This must always be null. |
| + * @return {Element} |
| + */ |
| + get parentNode() { |
| + return null; |
| + }, |
| + |
| + /** |
| + * The total time of the video. |
| + * @type {number} |
| + */ |
| + get duration() { |
| + return this.duration_; |
| + }, |
| + |
| + /** |
| + * The current timestamp of the video. |
| + * @type {number} |
| + */ |
| + get currentTime() { |
| + return this.currentTime_; |
| + }, |
| + set currentTime(currentTime) { |
| + this.currentTime_ = currentTime; |
| + }, |
| + |
| + /** |
| + * If this video is pauses or not/ |
|
fukino
2014/07/18 10:18:43
trailing slash. Should it be period?
yoshiki
2014/07/18 15:56:34
Done.
|
| + * @type {boolean} |
| + */ |
| + get paused() { |
| + return false; |
| + }, |
| + |
| + /** |
| + * If this video is ended or not/ |
| + * @type {boolean} |
| + */ |
| + get ended() { |
| + return false; |
| + }, |
| + |
| + /** |
| + * If this video is seelable or not/ |
| + * @type {boolean} |
| + */ |
| + get seekable() { |
| + return false; |
| + }, |
| + |
| + /** |
| + * Value of the volume |
| + * @type {number} |
| + */ |
| + get volume() { |
| + return this.volume_; |
| + }, |
| + set volume(volume) { |
| + this.volume_ = volume; |
| + }, |
| + |
| + /** |
| + * Returns the source of the current video. |
| + * @return {string} |
| + */ |
| + get src() { |
| + return this.src_; |
| + }, |
| + |
| + /** |
| + * Plays the video. |
| + */ |
| + play: function() { |
| + // TODO(yoshiki): Implement this. |
| + }, |
| + |
| + /** |
| + * Pauses the video. |
| + */ |
| + pause: function() { |
| + // TODO(yoshiki): Implement this. |
| + }, |
| + |
| + /** |
| + * Loads the video. |
| + */ |
| + load: function() { |
| + // TODO(yoshiki): Implement this. |
| + }, |
| +}; |