是什么为Android的MediaPlayer和VideoView之间的区别区别、Android、MediaPlayer、VideoView

2023-09-12 10:58:14 作者:忘怀讲解

我不知道什么是他们两个人之间不同的视频流?

I just wonder what are the different between two of them for streaming video?

我知道 VideoView 可用于流媒体,什么是媒体播放器?据我所知道的是的MediaPlayer 可以做同样的事情, VideoView 吧?

I know VideoView can be used for streaming and what is for Mediaplayer? so far as I know is MediaPlayer can do the same thing as VideoView right?

谁能给我答案?

如果我想使用RTSP至Android流从服务器上的视频,我应该怎么启动呢? VideoView 的MediaPlayer

And if I want to streaming video from the server by using RTSP to Android, what should I start up with? VideoView or MediaPlayer?

任何建议?

推荐答案

在问同样的问题,当我从什么马克(CommonsWare)advised在这里多个线程,VideoView是一个包装(200百行的code)在MediaPlayer的和SurfaceView提供嵌入式控制。

Was asking the same question and as I understood from what Mark (CommonsWare) advised on numerous threads here, VideoView is a wrapper (200 hundred lines of code) for MediaPlayer and SurfaceView to provide embedded controls.

他也亲切地分享了一些例子:

He also kindly shared some examples:

https://github.com/commonsguy/cw-advandroid/blob/master/Media/Video/src/com/commonsware/android/video/VideoDemo.java

https://github.com/commonsguy/vidtry/blob/master/src/com/commonsware/android/vidtry/Player.java

和例如从Android SDK中 http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo.html

and example from android sdk http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo.html

还有些人有问题,播放视频的模拟器,所以一定要确保,如果你有问题,在实际设备进行测试

Also some people had issues playing video on emulator, so make sure to test it on actual device if you have issues