公司的服务器是基于Adboe的Red5流媒体服务器。rtmp协议的视频流传输。这个好像是不能直接播放的。应该怎么办哇,求高人解答。 在WebView中加入Flash在播放视频可以么。有木有资料可以参考哇,谢谢大家。还有就是下载下来在播放肯定是不行的。。要的就是即时播放功能。
解决方案 »
- 为什么在server里传到activity里的list是null啊
- setListAdapter()总是显示有误
- 关于用webview开发浏览器
- android如何混淆打包apk
- [Android:Bluetooth]请教各位达人,bluetoothDock是什么
- ViewPager不支持1.6版本 这个问题怎么解决 ?
- android 添加一个带gson 的函数出现VerifyError的问题
- android聊天 如何保存与每个人聊天的历史记录
- AndroidStudio 中查看DDMS的问题
- 求助。照搬《第一行代码-Android》的HttpURLConnection方法屏幕无显示?
- 用NDK编译动态库时头文件的问题
- SystemProperties.get()函数得到的值是什么地方设定的?
RTSP (RTP, SDP)
HTTP progressive streaming
HTTP live streaming draft protocol (Android 3.0 and above)
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.EditText;public class Player extends Activity implements OnClickListener {
WebView webView;
String bodyHtml;
String rtmpUrl;
String fileName;
Button refreshButton;
String htmlPost = "</body></html>";
String htmlPre = "<!DOCTYPE html>"
+ "<html lang=\"en\">"
+ "<head><meta charset=\"utf-8\">"
+ "</head>"
+ "<body style='margin:0; pading:0;"
+ " background-color: #71D5CA;'>";// String htmlCode = "<embed "
// + "type=\"application/x-shockwave-flash\""
// + "id=\"player1\" " + "name=\"player1\" "
// + "src=\"http://developer.longtailvideo.com"
// + "/svn/trunk/fl5/player.swf\""
// + "width=\"320\""
// + "height=\"280\"" + " flashvars=@FILESRC@"
// + "allowfullscreen=\"true\""
// + "allowscripaccess=\"always\""
// + "/> ";
String htmlCode = "<embed "
+ "type=\"application/x-shockwave-flash\""
+ "id=\"player1\" " + "name=\"player1\" "
+ "src=\"D:\red5test-2.swf"
+ "width=\"320\""
+ "height=\"280\""
+ "allowfullscreen=\"true\""
+ "allowscripaccess=\"always\""
+ "/> ";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main); 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();
} 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.loadData(
htmlPre + htmlCode
+ htmlPost, "text/html", "UTF-8");
// webView.loadDataWithBaseURL("http://127.0.0.1",
// htmlPre + bodyHtml
// + htmlPost, "text/html", "UTF-8", null);
}}
大家看看有思路没有。这样可以吗,帮忙看看
2、red5 是支持直播的。
Strobe and Flash Media Playback will do RTMP or Flash HTTP:
Strobe
http://www.osmf.org/strobe_mediaplayback.htmlFlash Media Playback (easiest)
http://www.osmf.org/strobe_mediaplayback.html
http://www.wowzamedia.com/forums/con...h-Wowza-Server
http://stackoverflow.com/questions/6349714/the-easiest-way-to-play-an-audio-rtmp-stream-in-android