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 |
| index 04aa82da26dff7d1e53f3b363ff160461e8033b9..78751a9e8f8e8b4608f658613a6fc19428433432 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 |
| @@ -189,9 +189,9 @@ CastVideoElement.prototype = { |
| function () { |
| this.playInProgress_ = false; |
| }.wrap(this), |
| - function () { |
| + function (error) { |
|
hirono
2014/08/05 01:01:59
nit: We don't need a space between 'function' and
yoshiki
2014/08/05 01:40:24
Done.
|
| this.playInProgress_ = false; |
| - this.onCastCommandError_(); |
| + this.onCastCommandError_(error); |
| }.wrap(this)); |
| }.wrap(this); |
| @@ -215,9 +215,9 @@ CastVideoElement.prototype = { |
| function () { |
| this.pauseInProgress_ = false; |
| }.wrap(this), |
| - function () { |
| + function (error) { |
| this.pauseInProgress_ = false; |
| - this.onCastCommandError_(); |
| + this.onCastCommandError_(error); |
| }.wrap(this)); |
| }, |
| @@ -256,8 +256,10 @@ CastVideoElement.prototype = { |
| opt_callback(); |
| }.bind(this)); |
| }.bind(this)).catch(function(error) { |
| + this.unloadMedia_(); |
| + this.dispatchEvent(new Event('error')); |
| console.error('Cast failed.', error.stack || error); |
| - }); |
| + }.bind(this)); |
| }, |
| /** |
| @@ -268,7 +270,7 @@ CastVideoElement.prototype = { |
| if (this.castMedia_) { |
| this.castMedia_.stop(null, |
| function () {}, |
| - function () { |
| + function (error) { |
| // Ignores session error, since session may already be closed. |
| if (error.code !== chrome.cast.ErrorCode.SESSION_ERROR) |
| this.onCastCommandError_(error); |
| @@ -354,11 +356,13 @@ CastVideoElement.prototype = { |
| /** |
| * This method should be called when a media command to cast is failed. |
| + * @param {Object} error Object representing the error. |
| * @private |
| */ |
| - onCastCommandError_: function() { |
| + onCastCommandError_: function(error) { |
| this.unloadMedia_(); |
| this.dispatchEvent(new Event('error')); |
| + console.error('Error on sending command to cast.', error.stack || error); |
| }, |
| /** |