问题描述
Ineed打在我的Android应用程序很短的MP4视频我在寻找如何加载MP4视频信息,但我找不到这样做在Android 1.5的方式。我前人的精力应用兼容于Android 1.5〜4.0
Ineed to play a short MP4 video on my android app I'm searching info about how to load mp4 videos but i can't find the way to do it on Android 1.5. My app sould be compatible from Android 1.5 to 4.0
我tryed有很多从谷歌的教程,但他们都不工作。例如,现在我想从Android开发者的VideoViewDemo:http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/VideoViewDemo.html
I tryed with a lot of tutorials from google, but none of them works. For example, now i'm trying with the VideoViewDemo from android developers: http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/VideoViewDemo.html
我有我的资产文件夹中的视频,而我只需要播放视频,仅此。我不能相信,不存在一个简单,快捷的方式来做到这一点。
I have a video on my ASSETS folder, and i just need to play the video, only this. I can not believe that doesn't exists a simple and quick way to do it.
请,如果有人知道如何做到这一点我会在preciate你有很大的帮助。
Please, if someone knows how to do it i will apreciate your help a lot.
感谢
推荐答案
您可以把视频中的原始文件夹而不是构建一个URI是这样的:
You could put the video in the raw folder instead and construct a URI like this:
android.resource://[package]/[resource_id]
android.resource://[package]/[res type]/[res name]
例如:
Uri videoUri = Uri.parse("android:resource://com.my.package/"+R.raw.myVideo);
mVideoView.setVideoURI(videoUri);
这篇关于如何播放存储资产的文件夹上Android 1.5的MP4视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!