i have a list of YouTube videos and i want to play videos on media player of native mobile phone.i am able to invoke web browsers and youtube app but cant invoke default mediaplayer of android/IOS phone.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
This is the whole implementation made to implement media player in my xamarin app which is having mvvm support.
First of all, you need to add the plugin Media Manager ( Nuget or GitHub ) to three of your projects(Portable, Droid and iOS). For that, you need to right-click on your project and click on the Manage NuGet Packages option and browse for plugins
Then, you need to initialize VideoView, so add this code to your MainActivity file of Droid in onCreate.
protected override void OnCreate(Bundle bundle) { TabLayoutResource = Resource.Layout.Tabbar; ToolbarResource = Resource.Layout.Toolbar;
Now make one view like this.
This is my xaml file: MediaPlayer.xaml
And this is my xaml.cs file
MediaPLayer.xaml.cs
That's all, You can play the video from URL like this.