Android playing Video data from a custom network stream?
Does Android MediaPlayer can only work with file sources? I would like play media (video) from a network stream, but the stream comes in a non-standard protocol, so I have to somehow feed Android MediaPlayer with the data only.
Is there anyway to开发者_开发知识库 do that? I found a few web pages suggesting using a temporary file for the buffered media data etc. but I would like to minimize the I/O usage as much as I can, so I'm looking for a API only solution if there is any? how about JNI? but looks like the permissions going to be an issue with that also.
Does Android MediaPlayer can only work with file sources?
No, it handles HTTP and RTSP streams as well.
I would like play media (video) from a network stream, but the stream comes in a non-standard protocol, so I have to somehow feed Android MediaPlayer with the data only.
That will be difficult. If this were audio, you could use AudioTrack, but there is no video equivalent for this.
One answer is to create a server-side proxy that converts your non-HTTP, non-RTSP stream into an HTTP or RTSP stream, so the existing Android streaming support works.
Basically Android supports HTTP and RTSP video playback for network videos
This link may help you Click Here
精彩评论