简体   繁体   English

将视频文件保存在资产文件夹中?

[英]Keeping video file in asset folder?

can we keep a video in the assets folder, i am developing an app where i taught to guide the users by showing video of how the app works instead of snap shots and texts????我们可以在 assets 文件夹中保留视频吗?我正在开发一个应用程序,我在其中教过如何通过显示应用程序如何工作的视频而不是快照和文本来指导用户????

Is it the good way of keeping video or we need keep the texts and snap shorts?这是保留视频的好方法,还是我们需要保留文本和短裤? can someone help me because i am new to android.有人可以帮助我吗,因为我是 android 的新手。

Thanks.谢谢。

I think you can keep the video your_video.avi in raw folder so you can play it with VideoPlayer passing R.raw.your_video to it;我认为你可以将视频your_video.aviraw文件夹中,这样你就可以使用VideoPlayer将它传递给R.raw.your_video来播放它;

It is better than storing videos in assets because in assets all the assets files are internally stored as one big file and this can lead to complications when playing multimedia files.这比将视频存储在资产中要好,因为在资产中,所有资产文件都在内部存储为一个大文件,这可能会导致播放多媒体文件时出现问题。

any file can be kept in assets folder and accessed using任何文件都可以保存在资产文件夹中并使用

activity.getAssets().open(""); activity.getAssets().open("");

You can place your video file in raw folder instead of assets.您可以将视频文件放在原始文件夹而不是资产中。

And if you are playing these file using videoview or media player instance you need Uri of the file to play it.如果您使用 videoview 或媒体播放器实例播放这些文件,您需要文件的 Uri 来播放它。 Below is the Uri to play video file下面是播放视频文件的Uri

"android.resource://com.com.com/raw/filename" “android.resource://com.com.com/raw/filename”

//replace com.com.com with your package name and file with your file name but dont include extension //将 com.com.com 替换为您的 package 名称并将文件替换为您的文件名但不包含扩展名

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

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