简体   繁体   English

Android 1.5 VideoView / MediaPlayer类是否有可用的示例?

[英]Is there a working sample for the Android 1.5 VideoView/MediaPlayer class?

I'm new to Android dev. 我是Android开发人员的新手。

There's a very pretty state diagram of the MediaPlayer , but I can't for the life of me figure out how to actually use this class to play a video. MediaPlayer有一个非常漂亮的状态图,但是我一辈子都无法弄清楚如何实际使用此类播放视频。

There's a view samples around the 'net, but they seem to be for previous versions of the SDK. 网上有一个视图示例,但它们似乎适用于早期版本的SDK。 I've also checked the official samples , but with no luck. 我也检查了官方样品 ,但没有运气。

Yes. 是。 There is example code for VideoView and MediaPlayer in: 以下是VideoView和MediaPlayer的示例代码:

<android-sdk>/platforms/android-1.5/samples/ApiDemos/src/com/example/android/apis/media/

These aren't linked anywhere in the online help, as the samples there are out of sync with what is actually shipped. 这些没有在联机帮助中的任何地方链接,因为那里的示例与实际发货的不同步。

Edit: Note the samples exist, but they don't work in Android 1.5, see this bug . 编辑:请注意示例存在,但是它们在Android 1.5中不起作用,请参见此bug

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM