[英]I'm using c# and mono and trying to play simple video file from my android but it dosent work
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using Android.Media;
namespace MoviePlayer
{
[Activity(Label = "MoviePlayer", MainLauncher = true, Icon = "@drawable/icon")]
public class Activity1 : Activity
{
int count = 1;
MediaPlayer mp;
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
mp = new MediaPlayer();
mp.Prepare();
mp.SetDataSource()
mp.Start();
}
}
}
I don't know what should be in the mp.SetDataSource() I looked on examples but didn't understand. 我不知道在看示例但不理解的mp.SetDataSource()中应该包含什么。
You need to pass a path to the file you want to play as a string
to the SetDataSource()
method to play that file. 您需要将要播放的文件的路径作为
string
传递给SetDataSource()
方法以播放该文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.