简体   繁体   中英

monodroid play video from assets

I am using monoandroid and I would like use that:

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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