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

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

Issue 514163002: Video Player: Close the session when the other device is selected to play (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@temp
Patch Set: . 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/video_player.js
diff --git a/ui/file_manager/video_player/js/video_player.js b/ui/file_manager/video_player/js/video_player.js
index 38e16057b3d0fe46f52a77d79cf0e9cd7e6cc2ac..5c581a812efa26e998a735f18dfe9bc22c3d8865 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -503,9 +503,15 @@ VideoPlayer.prototype.onCastSelected_ = function(cast) {
if ((this.currentCast_ && this.currentCast_.label) === (cast && cast.label))
return;
- this.currentCast_ = cast || null;
- this.updateCheckOnCastMenu_();
- this.reloadCurrentVideo();
+ this.unloadVideo(false);
+
+ // Waits for unloading video.
+ this.loadQueue_.run(function(callback) {
+ this.currentCast_ = cast || null;
+ this.updateCheckOnCastMenu_();
+ this.reloadCurrentVideo();
+ callback();
+ }.wrap(this));
};
/**
« 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