我对Xamarin很新颖...Xamarin Forms视频播放器(MediaManager插件)
我试图创建一个类似于应用的YouTube。我不知道如何在我的应用程序内播放视频。我试图使用MediaManager插件https://github.com/martijn00/XamarinMediaManager,但根本无法弄清楚。
如果任何人都可以建议一个不同的插件,或者详细解释如何使用MediaManager插件,那就太棒了。
该插件的文档是残暴的,我根本无法理解它。
继承人我到目前为止:我只是试图通过按钮点击播放视频。
XAML文件:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="App2.Video_Play_Page"
Title="Video_Play_Page"
BackgroundColor="#4B1388">
<ContentPage.Content>
<StackLayout Padding="10, 10, 10, 10">
<Label Text="video Player..." />
<Button Clicked="PlayVideo" Text="Play me!"/>
</StackLayout>
</ContentPage.Content>
Xaml.cs文件:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using Plugin.MediaManager;
namespace App2
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class Video_Play_Page : ContentPage
{
public Video_Play_Page()
{
InitializeComponent();
}
private void PlayVideo(object sender, EventArgs e)
{
CrossMediaManager.Current.Play("https://www.youtube.com/watch?v=Gm8bQxnold0");
}
}
}
注:我不知道我是否已经正确安装了一切。如果有人能解释一下,那也会很棒。
会[此答案](https://stackoverflow.com/a/44522846/7196681)有帮助吗? – Curiousity