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

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

Issue 578823002: Video Player: Show the status icon on display when the status is changed (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/media_controls.js » ('j') | 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 ccbc342f5dbb6f133fe92d3e5dff1b3d881ffd3e..e3ca6e5599f30346b3a269dd729f200d06abf06f 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
@@ -217,10 +217,23 @@ CastVideoElement.prototype = {
/**
* Plays the video.
+ * @param {boolean=} opt_seeking True when seeking. False otherwise.
*/
- play: function() {
+ play: function(opt_seeking) {
+ if (this.playInProgress_)
+ return;
+
var play = function() {
- this.castMedia_.play(null,
+ if (this.castMedia_.playerState ===
+ chrome.cast.media.PlayerState.PLAYING) {
+ return;
+ }
+
+ var playRequest = new chrome.cast.media.PlayRequest();
+ playRequest.customData = {seeking: !!opt_seeking};
+
+ this.castMedia_.play(
+ playRequest,
function() {
this.playInProgress_ = false;
}.wrap(this),
@@ -240,13 +253,23 @@ CastVideoElement.prototype = {
/**
* Pauses the video.
+ * @param {boolean=} opt_seeking True when seeking. False otherwise.
*/
- pause: function() {
+ pause: function(opt_seeking) {
if (!this.castMedia_)
return;
+ if (this.pauseInProgress_ ||
+ this.castMedia_.playerState === chrome.cast.media.PlayerState.PAUSED) {
+ return;
+ }
+
+ var pauseRequest = new chrome.cast.media.PauseRequest();
+ pauseRequest.customData = {seeking: !!opt_seeking};
+
this.pauseInProgress_ = true;
- this.castMedia_.pause(null,
+ this.castMedia_.pause(
+ pauseRequest,
function() {
this.pauseInProgress_ = false;
}.wrap(this),
« no previous file with comments | « no previous file | ui/file_manager/video_player/js/media_controls.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698