Theo ghi chú phát hành, StageFright thay thế khung công tác OpenCore trong bản phát hành GingerBread. Dường như đã có nhiều cuộc thảo luận cho biết: Phát trực tuyến HTTP của Apple được hỗ trợ theo mặc định kể từ Android 2.3. Ngay cả các Wikipedia đề cập đến điều này.
Tuy nhiên, khi tôi cố gắng chạy test stream cung cấp bởi Apple sử dụng MediaPlayerDemo_Video.java
kèm với Demo API tôi nhận được ngoại lệ sau:Khung MediaPlayer trên GingerBread và Hỗ trợ phát trực tuyến HTTP của Apple
setDataSource('http://devimages.apple.com/iphone/samples/bipbop/gear1/
prog_index.m3u8')
connect to devimages.apple.com:80/iphone/samples/bipbop/gear1/
prog_index.m3u8 @0
INFO/NuCachedSource2(34): ERROR_END_OF_STREAM
error (1, -2147483648)
ERROR/MediaPlayerDemo(667): error: Prepare failed.: status=0x1
java.io.IOException: Prepare failed.: status=0x1
at android.media.MediaPlayer.prepare(Native Method)
at
com.video.stream.MediaPlayerDemo_Video.playVideo(MediaPlayerDemo_Video.java:
125)
at
com.video.stream.MediaPlayerDemo_Video.surfaceCreated(MediaPlayerDemo_Video.java:
181)
...
surfaceChanged called
Displayed com.video.stream/.MediaPlayerDemo_Video: +1s652ms (total
+7s427ms)
GC_EXPLICIT freed 2K, 55% free 2514K/5511K, external 716K/1038K,
paused 183ms
GC_EXPLICIT freed 17K, 52% free 2782K/5767K, external 716K/1038K,
paused 87ms
GC_EXPLICIT freed 68K, 50% free 2972K/5895K, external 2544K/3109K,
paused 104ms
request time failed: java.net.SocketException: Address family not
supported by protocol
--- mã có liên quan (MediaPlayerDemo_Video.java):
path = "http://devimages.apple.com/iphone/samples/bipbop/gear1/
prog_index.m3u8";
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);
Câu hỏi:
1. GingerBread có thực sự hỗ trợ giao thức HTTP Live Streaming của Apple không?
2. Điều gì đã xảy ra ở trên?
Vui lòng trợ giúp.
Tôi đã thêm {{citation needed}} trên trang Wiki và có vẻ như tác giả đã phản hồi bằng cách thay đổi phần. – Samuh
SDK xem trước cho Honeycomb có sẵn để tải xuống và được quảng cáo để hỗ trợ m3U8. tuy nhiên, tôi không thể chơi thử nghiệm của Apple trên đó. – Samuh
Tôi đã gửi lỗi cho vấn đề này: http://code.google.com/p/android/issues/detail?id=14646&q=stars%3D2&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars – Samuh