我正在为 android 设备 (Android TV Box) 开发一个允许
授权用户使用Adobe Flash通过RTMP协议(protocol)观看“数字 channel ”
媒体服务器。我需要创建一个服务器端应用程序才能进行流式传输,还是我可以托管
视频?已经搜索了很多但没有运气,任何帮助将不胜感激谢谢。
我已经尝试过使用这样的 WebView
webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setPluginsEnabled(true);
webView.getSettings().setSupportZoom(true);
webView.getSettings().setAppCacheEnabled(true);
refreshButton =
(Button) findViewById(R.id.main_bt_refresh);
refreshButton.setOnClickListener(this);
refreshFileName();
}
@Override
public void onClick(View v) {
refreshFileName();
}
private void refreshFileName() {
EditText etRtmpUrl =
(EditText) findViewById(R.id.setup_et_host);
EditText etFileName =
(EditText) findViewById(R.id.setup_et_file);
rtmpUrl = etRtmpUrl.getText().toString();
fileName = etFileName.getText().toString();
if (fileName.endsWith(".flv")) {
fileName = "flv:" + fileName;
}
bodyHtml = htmlCode;
bodyHtml = bodyHtml.replaceAll("@FILESRC@",
"\"file=" + fileName
+ "&streamer=" + rtmpUrl + "\"");
webView.loadDataWithBaseURL("http://127.0.0.1",
htmlPre + bodyHtml
+ htmlPost, "text/html", "UTF-8", null);
但是没有任何反应..
最佳答案
没有直接的方法,但您可以尝试使用 ffmpeg 的 javacv。我出于其他原因检查了它,看起来有些人正在使用它使用 RTMP 传输视频(检查此线程,搜索“rtmp”)
Convert video Input Stream to RTMP
或者您可以使用 Rtsp http://jennifer-androidworld.blogspot.in/2011/07/video-streaming-using-rtsp-in-android.html?spref=bl
关于android - 使用 Adobe Flash Media Server 的 RTMP 视频流,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21405611/