Better media player error messages

This commit is contained in:
ByteHamster 2019-08-18 12:44:51 +02:00
parent 795952711e
commit 5774d9d2c7
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>