简体   繁体   English

monodroid播放资产中的视频

[英]monodroid play video from assets

I am using monoandroid and I would like use that: 我正在使用monoandroid,我想使用它:

var uri = Android.Net.Uri.Parse ("Content/video.m4v");
            video.SetVideoURI (uri);
            video.Start();

In order to play the video but I am wrong on find the right path, how do that ? 为了播放视频,但我找不到正确的路径,该怎么做?

An alternative way to play sounds is to add the file in the Resources/Raw directory then use the following: 播放声音的另一种方法是将文件添加到Resources / Raw目录中,然后使用以下命令:

var player = global::Android.Media.MediaPlayer.Create(this, Resource.Raw.YourSound);
player.Start();
player.Completion += (m_sender, m_e) =>
{
player.Release();
player = null;
};

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

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