我正在使用c#和mono并尝试从我的android播放简单的视频文件,但它起作用了

时间:2011-08-01 17:23:11

标签: c# mono

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();

        }
    }
}

我不知道mp.SetDataSource()应该是什么 我看了一些例子,但不明白。

1 个答案:

答案 0 :(得分:1)

您需要将路径发送到要作为string {{1}}方式播放的文件,以播放该文件。

SetDataSource()

Mono Documentation