查看 android 错误报告中的问题。用 httplive 替换 http 对我有用。以下是错误报告中的示例代码
private void playVideo(Integer Media) {
doCleanUp();
try {
switch (Media) {
case Globals.TEST_HTTP:
path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
break;
case Globals.TEST_HTTPLIVE:
path = "httplive://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8";
break;
}
mMediaPlayer = new MediaPlayer();
mMediaPlayer.setDataSource(path);
mMediaPlayer.setDisplay(holder);
mMediaPlayer.prepare();
mMediaPlayer.setOnBufferingUpdateListener(this);
mMediaPlayer.setOnCompletionListener(this);
mMediaPlayer.setOnPreparedListener(this);
mMediaPlayer.setOnVideoSizeChangedListener(this);
mMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
} catch (Exception e) {
Log.e(TAG, "error: " + e.getMessage(), e);
}
}