开发者

RTP Client Application on Android Mobile Device

开发者 https://www.devze.com 2023-02-16 19:12 出处:网络
Hey folks,i am developing a RTP client on an Android device which can play streaming videos from a server.

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 开发者_如何学Goand completely clueless..:(


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号