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

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

Issue 495003002: Video Player: Show appropriate message on playing unsupported video (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 31f056ea2f9f4202849ccec53ab0e81aecedadab..47940eaef3e6bc058f606ba865b5613f834951ef 100644
--- a/ui/file_manager/video_player/js/video_player.js
+++ b/ui/file_manager/video_player/js/video_player.js
@@ -101,11 +101,18 @@ FullWindowVideoControls.prototype.showErrorMessage = function(message) {
/**
* Handles playback (decoder) errors.
+ * @param {MediaError} error Error object.
* @private
*/
-FullWindowVideoControls.prototype.onPlaybackError_ = function() {
- this.showErrorMessage('GALLERY_VIDEO_DECODING_ERROR');
- this.decodeErrorOccured = true;
+FullWindowVideoControls.prototype.onPlaybackError_ = function(error) {
+ if (error.target &&
+ error.target.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
+ this.showErrorMessage('GALLERY_VIDEO_ERROR');
+ this.decodeErrorOccured = false;
+ } else {
+ this.showErrorMessage('GALLERY_VIDEO_DECODING_ERROR');
+ this.decodeErrorOccured = true;
+ }
// Disable inactivity watcher, and disable the ui, by hiding tools manually.
this.inactivityWatcher.disabled = true;
« 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