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

Unified Diff: ui/file_manager/video_player/js/cast/cast_video_element.js

Issue 506583002: Video Player: Support seek on casting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed the comment Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 384474f78c595ee5f94a3d775a171edd51fd7695..f436c9a0a0febe3d33aa01af3f8ac2b802262aec 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
@@ -91,7 +91,11 @@ CastVideoElement.prototype = {
}
},
set currentTime(currentTime) {
- // TODO(yoshiki): Support seek.
+ var seekRequest = new chrome.cast.media.SeekRequest();
+ seekRequest.currentTime = currentTime;
+ this.castMedia_.seek(seekRequest,
+ function() {},
+ this.onCastCommandError_.wrap(this));
},
/**
@@ -119,12 +123,16 @@ CastVideoElement.prototype = {
},
/**
- * If this video is seekable or not.
- * @type {boolean}
+ * TimeRange object that represents the seekable ranges of the media
+ * resource.
+ * @type {TimeRanges}
*/
get seekable() {
- // TODO(yoshiki): Support seek.
- return false;
+ return {
+ length: 1,
+ start: function(index) { return 0; },
+ end: function(index) { return this.currentMediaDuration_; },
+ };
},
/**
« 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