Commit 38394720 authored by yoshiki's avatar yoshiki Committed by Commit bot

Video Player: Change error string when casting

BUG=405860
TEST=manual

Review URL: https://codereview.chromium.org/545233002

Cr-Commit-Position: refs/heads/master@{#293705}
parent c47cc4cb
......@@ -948,6 +948,9 @@ Press any key to continue exploring.
<message name="IDS_VIDEO_PLAYER_PLAY_ON" desc="Message is shown above the list of cast devices. The user will select one of them to play the current video on selected device.">
Play on
</message>
<message name="IDS_VIDEO_PLAYER_VIDEO_FILE_UNSUPPORTED_FOR_CAST" desc="Error message which is shown when the video which an user tried to play is not supported by the current cast device.">
Sorry, this video is not supported by your cast device.
</message>
<!-- Imageburn Strings -->
<message name="IDS_CHECKING_FOR_UPDATES" desc="Notification for checking for update">
......
......@@ -523,6 +523,8 @@ bool FileBrowserPrivateGetStringsFunction::RunSync() {
IDS_VIDEO_PLAYER_PLAY_THIS_COMPUTER);
SET_STRING("VIDEO_PLAYER_PLAYING_ON", IDS_VIDEO_PLAYER_PLAYING_ON);
SET_STRING("VIDEO_PLAYER_PLAY_ON", IDS_VIDEO_PLAYER_PLAY_ON);
SET_STRING("VIDEO_PLAYER_VIDEO_FILE_UNSUPPORTED_FOR_CAST",
IDS_VIDEO_PLAYER_VIDEO_FILE_UNSUPPORTED_FOR_CAST);
#undef SET_STRING
dict->SetBoolean("PDF_VIEW_ENABLED",
......
......@@ -22,6 +22,8 @@ function FullWindowVideoControls(
this.playerContainer_ = playerContainer;
this.decodeErrorOccured = false;
this.casting = false;
this.updateStyle();
window.addEventListener('resize', this.updateStyle.wrap(this));
document.addEventListener('keydown', function(e) {
......@@ -107,7 +109,10 @@ FullWindowVideoControls.prototype.showErrorMessage = function(message) {
FullWindowVideoControls.prototype.onPlaybackError_ = function(error) {
if (error.target && error.target.error &&
error.target.error.code === MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED) {
this.showErrorMessage('GALLERY_VIDEO_ERROR');
if (this.casting)
this.showErrorMessage('VIDEO_PLAYER_VIDEO_FILE_UNSUPPORTED_FOR_CAST');
else
this.showErrorMessage('GALLERY_VIDEO_ERROR');
this.decodeErrorOccured = false;
} else {
this.showErrorMessage('GALLERY_VIDEO_DECODING_ERROR');
......@@ -301,6 +306,7 @@ VideoPlayer.prototype.loadVideo_ = function(video, opt_callback) {
document.querySelector('#error').removeAttribute('visible');
this.controls.inactivityWatcher.disabled = true;
this.controls.decodeErrorOccured = false;
this.controls.casting = !!this.currentCast_;
videoPlayerElement.setAttribute('loading', true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment