我正在尝试将视频从 Wowza 流式传输到 Android。我尝试设置 MediaPlayer() 和 path "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"
,但没有成功。我明白了:
ARTSPConnection:服务器意外关闭了连接。
关于如何解决这个问题的任何建议?
我正在尝试将视频从 Wowza 流式传输到 Android。我尝试设置 MediaPlayer() 和 path "rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov"
,但没有成功。我明白了:
ARTSPConnection:服务器意外关闭了连接。
关于如何解决这个问题的任何建议?
这就是我们需要从 wowza 流式传输的方式:
String SrcPath ="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview);
myVideoView.setVideoURI(Uri.parse(SrcPath));
Log.i("parse path",Uri.parse(SrcPath)+"");
myVideoView.setMediaController(new MediaController(this));
myVideoView.requestFocus();
myVideoView.start();}
但在您执行此操作之前,请将“bigbuckbunny”视频文件复制到 wowza 设置中的“vod”文件夹。
好吧,我的解决方案是创建一个 HTML 页面,该页面将 RTMP url 作为参数,并使用 Flash Media Playback 将通过 Flash 播放流...
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=1;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta names="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<title>#############</title>
<script type="text/javascript">
function resizeHandler()
{
var flash = document.getElementById("FlashMovie");
window.scrollTo(0, 1);
flash.focus();
flash.focus();
}
window.onresize = resizeHandler;
window.onload = resizeHandler;
</script>
</head>
<body style="margin:0; padding:0; background: #000;">
<div style="margin:0; padding:0; width:100%; height:100%">
<embed id="FlashMovie" style="width:100%; height:100%" src="http://fpdownload.adobe.com/strobe/FlashMediaPlayback.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" fullScreenOnSelection="true" scale="showall" flashvars="src=rtmp%3A%2F%2F########%2Flive%2FmyStream.sdp&playButtonOverlay=true&loop=true&autoPlay=true&streamType=live&initialBufferTime=2" pluginspage="https://play.google.com/store/apps/details?id=com.adobe.flashplayer"></embed>
</div>
<br /><br /><br />
</body>
</html>