是什么为Android的MediaPlayer和VideoView之间的区别 [英] What are the difference between MediaPlayer and VideoView for Android

查看:1087
本文介绍了是什么为Android的MediaPlayer和VideoView之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)<一个明白href="http://stackoverflow.com/questions/2923317/android-different-ways-of-playing-video">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:

<一个href="https://github.com/commonsguy/cw-advandroid/blob/master/Media/Video/src/com/commonsware/android/video/VideoDemo.java">https://github.com/commonsguy/cw-advandroid/blob/master/Media/Video/src/com/commonsware/android/video/VideoDemo.java

<一个href="https://github.com/commonsguy/vidtry/blob/master/src/com/commonsware/android/vidtry/Player.java">https://github.com/commonsguy/vidtry/blob/master/src/com/commonsware/android/vidtry/Player.java

和例如从Android SDK中 <一href="http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/MediaPlayerDemo.html">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

这篇关于是什么为Android的MediaPlayer和VideoView之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆