RTP Client Application on Android Mobile Device
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.
Prepare website with javascript code and streams list
Create layout with webview with javascript enabled for example:
Webview wv = (WebView) findViewById(R.id.WebView01); wv.setJavaScriptEnabled(true);
Add class that will be invoked by javascript like in the Dev Guide above:
wv.addJavascriptInterface(new JavaScriptInterface(this), "Android");`
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.
精彩评论