player error handling
This commit is contained in:
parent
2b65be2374
commit
303994dc58
2 changed files with 10 additions and 4 deletions
|
@ -57,10 +57,15 @@ public class VideoPlayer extends AppCompatActivity {
|
||||||
if (cause instanceof HttpDataSource.HttpDataSourceException) {
|
if (cause instanceof HttpDataSource.HttpDataSourceException) {
|
||||||
// An HTTP error occurred.
|
// An HTTP error occurred.
|
||||||
//System.out.println("Playback error F");
|
//System.out.println("Playback error F");
|
||||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_load_fail), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_conn_fail), Toast.LENGTH_SHORT).show();
|
||||||
player.release();
|
|
||||||
finish();
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
// An HTTP error occurred.
|
||||||
|
//System.out.println("Playback error F");
|
||||||
|
Toast.makeText(getApplicationContext(),getResources().getString(R.string.media_wrong_type), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
player.release();
|
||||||
|
finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
<string name="objectname">peces felices.mp4</string>
|
<string name="objectname">peces felices.mp4</string>
|
||||||
<string name="explorer_test_button">File Explorer Test</string>
|
<string name="explorer_test_button">File Explorer Test</string>
|
||||||
<string name="video_test_button">Video Test</string>
|
<string name="video_test_button">Video Test</string>
|
||||||
<string name="media_load_fail">Cannot load media file</string>
|
<string name="media_conn_fail">Cannot retrieve media file</string>
|
||||||
|
<string name="media_wrong_type">Invalid media file</string>
|
||||||
<string name="media_list_fail">Cannot connect to server</string>
|
<string name="media_list_fail">Cannot connect to server</string>
|
||||||
<string name="dummy_button">Dummy Button</string>
|
<string name="dummy_button">Dummy Button</string>
|
||||||
<string name="dummy_content">DUMMY\nCONTENT</string>
|
<string name="dummy_content">DUMMY\nCONTENT</string>
|
||||||
|
|
Loading…
Reference in a new issue