RTP Client Application on Android Mobile Device

匆匆过客 提交于 2019-11-30 18:17:05

问题


Hey folks,i am developing a RTP client on an Android device which can play streaming videos from a server. I am confused regarding how should i start about? i am thinking of developing a web app, using HTML,CSS and Javascript, which can later be wrapped in Android.is this approach correct? does javascript support real time media player? please guide me, i am a fresher and completely clueless..:(


回答1:


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.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/2672314/rtp-client-application-on-android-mobile-device

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