RTP Client Application on Android Mobile Device

岁酱吖の 提交于 2019-11-30 22:20:41
Witold Graca

You should play your video with MediaPlayer. Of course you can prepare dedicated website that lists available streams and wrap it up into WebView. Having this stream list in WebView you can write interface that will bind javascript on your webpage with proper interface in your Android code. Check out this section of Android Dev Guide:

And here is a list of supported media formats

I successfully played rtsp stream on Android 2.2 but I'm not sure if it's supported on previous versions.

To sum up.

  1. Prepare website with javascript code and streams list

  2. Create layout with webview with javascript enabled for example:

    Webview wv = (WebView) findViewById(R.id.WebView01);
    wv.setJavaScriptEnabled(true);
    
  3. Add class that will be invoked by javascript like in the Dev Guide above:

    wv.addJavascriptInterface(new JavaScriptInterface(this), "Android");`
    
  4. Play stream with MediaPlayer

Hope that helps.

I guess you may setup a streaming media server(live555, darwin stream server) to publish media file in rtsp protocol, and use VideoView on android to play it

If you create normal android app then MediaPlayer class will handle everything for you. Just feed it with rtp stream url, that is it.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!