MediaPlayer的框架上姜饼和苹果的HTTP实时流支持 [英] MediaPlayer Framework on GingerBread and Apple's HTTP Live Streaming Support
问题描述
根据发行说明,StageFright取代了姜饼释放的OpenCore框架。似乎已经有不少讨论,上面写着:苹果的HTTP实时流媒体是由于Android 2.3默认支持。即使是维基百科提到了这一点。
然而,当我尝试运行使用<$ c。通过苹果公司提供的测试流 $ C> MediaPlayerDemo_Video.java 捆绑API演示我得到的
但下列情况除外:
According to the release notes, StageFright replaces the OpenCore framework in the GingerBread release. It seems that there have been numerous discussion that says: Apple's HTTP Live streaming is supported by default since Android 2.3. Even the Wikipedia mentions this.
However, when I try to run the test stream provided by Apple using the MediaPlayerDemo_Video.java
bundled with API Demos I get the
following exceptions:
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
---相关code(MediaPlayerDemo_Video.java):
---relevant code(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);
问题:
1.是否姜饼共建真正支持苹果的HTTP实时流
协议?
2,出了什么问题上面?
Questions:
1. Does GingerBread build really support Apple's HTTP Live Streaming
protocol?
2. What went wrong above?
请帮忙。
推荐答案
好吧,我已经发现了一些数据,我会回答我的问题来更新这个帖子。如果有人有意见或其他方面的考虑,使表请补充。
Alright, I have found some data and I am going to update this thread by answering my own question. If someone has suggestions or other considerations to bring to table please add.
-
Stagefright
框架自带的蜂窝
构建支持HTTP实时流
。文档读取草案规范的大部分地区没有明确提到这部分。
Stagefright
framework that comes withHoneycomb
build supportsHTTP Live Streaming
. The documentation reads most parts of the draft specification without mentioning explicitly which parts.
视频和音频应符合支持href="http://developer.android.com/guide/appendix/media-formats.html">媒体格式。
The video and audio should conform to media formats supported by Android.
我是能够发挥用人 AES-128
加密内容保护流。虽然,仿真器(不幸的是,我没有足够的设备)的表现并不好。音频和视频是非常不同步。流媒体应用已经在真实设备上进行测试。
I was able to play content-protected streams employing AES-128
encryption. Though, the performance of the emulator(unfortunately, I did not have the device) was not good. Audio and Video were terribly out of sync. Streaming applications HAVE to be tested on real devices.
您无法通过HTTPS流数据。此外,为了为检测的流符合HTTPLive标准,你就必须更换HTTP://
的URL的一部分httplive://
You cannot stream your data over https. Also, in order to detect that the stream conforms to HTTPLive standard you'll have to replace "http://"
part of the URL with "httplive://"
这篇关于MediaPlayer的框架上姜饼和苹果的HTTP实时流支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!