Merge pull request #3326 from ByteHamster/media-player-messages

Better media player error messages
This commit is contained in:
H. Lehmann 2019-08-30 13:01:33 +02:00 committed by GitHub
commit ae606f552a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -16,10 +16,16 @@ public class MediaPlayerError {
case MediaPlayer.MEDIA_ERROR_SERVER_DIED:
resId = R.string.playback_error_server_died;
break;
case MediaPlayer.MEDIA_ERROR_UNSUPPORTED:
resId = R.string.playback_error_unsupported;
break;
case MediaPlayer.MEDIA_ERROR_TIMED_OUT:
resId = R.string.playback_error_timeout;
break;
default:
resId = R.string.playback_error_unknown;
break;
}
return context.getString(resId);
return context.getString(resId) + " (" + code + ")";
}
}

View File

@ -277,6 +277,8 @@
<string name="player_ready_msg">Ready</string>
<string name="player_seeking_msg">Seeking</string>
<string name="playback_error_server_died">Server died</string>
<string name="playback_error_unsupported">Unsupported media type</string>
<string name="playback_error_timeout">Operation timed out</string>
<string name="playback_error_unknown">Unknown Error</string>
<string name="no_media_playing_label">No media playing</string>
<string name="position_default_label" translate="false">00:00:00</string>