如何播放存储资产的文件夹上Android 1.5的MP4视频? [英] How to play MP4 videos stored on assets folder on Android 1.5?

查看:169
本文介绍了如何播放存储资产的文件夹上Android 1.5的MP4视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Ineed打在我的Andr​​oid应用程序很短的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

我trye​​d有很多从谷歌的教程,但他们都不工作。例如,现在我想从Android开发者的VideoViewDemo:<一href=\"http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/media/VideoViewDemo.html\" rel=\"nofollow\">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视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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