Play media (video) from a network stream(http) directly
I would like play media (video) from a network stream(http) directly, hence so I have to somehow feed Android MediaPlayer with the data.
I have FileOutputStream outstream = new FileOutputStream(outputfile); which I write into the outputfile by outstream.write(buffer, 0, count);
Is there any API which takes开发者_运维百科 stream as input....???.... Please help...
Android supports Progressive download and HTTP Live Streaming(only in 3.0) and both of these work over HTTP.
You can use VideoView
or Mediaplayer
to leverage Progressive downloading and play your videos: see this discussion.
Also, if your server, delivers segmented files(.ts) in conformance to Apple's Http Live Streaming IETF draft, you can directly supply the URL to MediaPlayer
and play your video using SurfaceView
. Note: that you will have to replace "http" with "httplive:" in your URL.
精彩评论