4

I am developing an application for android devices (Android TV Box) that allows

authenticatd users to watch "digital channels" through RTMP protocol by using Adobe Flash

Media Server.Do i need to create a server side app in order to stream, or can i just host the

videos? have searched alot but no luck, Any help will be appreciated Thanks.

I have tried this by using web view like this

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);

But giving no responce..

Shani Goriwal
  • 2,111
  • 1
  • 18
  • 30

1 Answers1

0

There is no direct approach but you can try javacv with ffmpeg. I checked it for other reasons, and it looks like some people are using it to transfer video using RTMP (check this thread, search for "rtmp")

https://code.google.com/p/android-rtmp-client/source/browse/trunk/example/com/ryong21/example/recorder/Recorder.java

Convert video Input Stream to RTMP

or you can go through Rtsp using http://jennifer-androidworld.blogspot.in/2011/07/video-streaming-using-rtsp-in-android.html?spref=bl

Community
  • 1
  • 1
Poison
  • 33
  • 7