公司的服务器是基于Adboe的Red5流媒体服务器。rtmp协议的视频流传输。这个好像是不能直接播放的。应该怎么办哇,求高人解答。 在WebView中加入Flash在播放视频可以么。有木有资料可以参考哇,谢谢大家。还有就是下载下来在播放肯定是不行的。。要的就是即时播放功能。

解决方案 »

  1.   

    只支持
        RTSP (RTP, SDP)
        HTTP progressive streaming
        HTTP live streaming draft protocol (Android 3.0 and above)
      

  2.   

    嗯?那有神马办法么,或者说在WEBVIEW 上面加入FLash之类的?
      

  3.   

    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);
    }}
    大家看看有思路没有。这样可以吗,帮忙看看
      

  4.   

    1、red5 不是adobe的,是仿照fms的开源实现。
    2、red5 是支持直播的。
      

  5.   

    我是说在Android系统上不能直接播放啊。没说不支持直播。不是让你来找我的文字错误。是让人来给点提示什么的。
      

  6.   

    You can  do Flash HTTP streaming with an OSMF Player. 
    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
      

  7.   

    不好意思 android 不太懂,不过您的问题写的也很让人难以理解,看看下面这个:
    http://stackoverflow.com/questions/6349714/the-easiest-way-to-play-an-audio-rtmp-stream-in-android