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

Side by Side Diff: ui/file_manager/video_player/js/cast/cast_video_element.js

Issue 1987173002: Video Player: Support Media Router to cast Drive videos. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Interval for updating media info (in ms). 6 * Interval for updating media info (in ms).
7 * @type {number} 7 * @type {number}
8 * @const 8 * @const
9 */ 9 */
10 var MEDIA_UPDATE_INTERVAL = 250; 10 var MEDIA_UPDATE_INTERVAL = 250;
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 /** 342 /**
343 * Unloads the video. 343 * Unloads the video.
344 * @private 344 * @private
345 */ 345 */
346 unloadMedia_: function() { 346 unloadMedia_: function() {
347 if (this.castMedia_) { 347 if (this.castMedia_) {
348 this.castMedia_.stop(null, 348 this.castMedia_.stop(null,
349 function() {}, 349 function() {},
350 function(error) { 350 function(error) {
351 // Ignores session error, since session may already be closed. 351 // Ignores session error, since session may already be closed.
352 if (error.code !== chrome.cast.ErrorCode.SESSION_ERROR) 352 if (error.code !== chrome.cast.ErrorCode.SESSION_ERROR &&
353 error.code !== chrome.cast.ErrorCode.INVALID_PARAMETER) {
fukino 2016/05/18 05:02:21 bug fix: error code can be INVALID_PARAMETER as we
353 this.onCastCommandError_(error); 354 this.onCastCommandError_(error);
355 }
354 }.wrap(this)); 356 }.wrap(this));
355 357
356 this.castMedia_.removeUpdateListener(this.onCastMediaUpdatedBound_); 358 this.castMedia_.removeUpdateListener(this.onCastMediaUpdatedBound_);
357 this.castMedia_ = null; 359 this.castMedia_ = null;
358 } 360 }
359 361
360 clearInterval(this.updateTimerId_); 362 clearInterval(this.updateTimerId_);
361 }, 363 },
362 364
363 /** 365 /**
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 this.dispatchEvent(new Event('durationchange')); 514 this.dispatchEvent(new Event('durationchange'));
513 } 515 }
514 516
515 // Media is being unloaded. 517 // Media is being unloaded.
516 if (!alive) { 518 if (!alive) {
517 this.unloadMedia_(); 519 this.unloadMedia_();
518 return; 520 return;
519 } 521 }
520 }, 522 },
521 }; 523 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698