求助,这个视频播放功能怎么做。 公司的服务器是基于Adboe的Red5流媒体服务器。rtmp协议的视频流传输。这个好像是不能直接播放的。应该怎么办哇,求高人解答。 在WebView中加入Flash在播放视频可以么。有木有资料可以参考哇,谢谢大家。还有就是下载下来在播放肯定是不行的。。要的就是即时播放功能。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 只支持 RTSP (RTP, SDP) HTTP progressive streaming HTTP live streaming draft protocol (Android 3.0 and above) 嗯?那有神马办法么,或者说在WEBVIEW 上面加入FLash之类的? package com.ryong21;import android.app.Activity;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); }}大家看看有思路没有。这样可以吗,帮忙看看 1、red5 不是adobe的,是仿照fms的开源实现。2、red5 是支持直播的。 我是说在Android系统上不能直接播放啊。没说不支持直播。不是让你来找我的文字错误。是让人来给点提示什么的。 You can do Flash HTTP streaming with an OSMF Player. Strobe and Flash Media Playback will do RTMP or Flash HTTP:Strobehttp://www.osmf.org/strobe_mediaplayback.htmlFlash Media Playback (easiest)http://www.osmf.org/strobe_mediaplayback.htmlhttp://www.wowzamedia.com/forums/con...h-Wowza-Server 不好意思 android 不太懂,不过您的问题写的也很让人难以理解,看看下面这个:http://stackoverflow.com/questions/6349714/the-easiest-way-to-play-an-audio-rtmp-stream-in-android android 签名后js无法调用android方法 listview item拖动到listview以外的区域。 代码生成的TextView怎样设置样式 Ubuntu下adb模拟器不能使用. 关于activity刷新显示的问题 android 的又一个bug? android:configChanges 如何配置监视STK弹框 SeerBar 被分成两部分 【求助】安卓的应用有ios那样的软件名称抢注问题吗? WebView加载html 用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