-
-
Notifications
You must be signed in to change notification settings - Fork 306
Xamarin.Forms
Martijn van Dijk edited this page Sep 25, 2019
·
1 revision
Adding a VideoView
to a Page in Forms is easy as this:
<mm:VideoView VerticalOptions="FillAndExpand" Source="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" />
Your Xamarin.Forms page could look like this:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:mm="clr-namespace:MediaManager.Forms;assembly=MediaManager.Forms"
x:Class="YourClassName" >
<ContentPage.Content>
<StackLayout>
<mm:VideoView VerticalOptions="FillAndExpand" Source="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" ShowControls="False" />
</StackLayout>
</ContentPage.Content>
</ContentPage>
You can even use the normal Play(object)
method and not set source. When you navigate to the view that contains the VideoView
, the player will automatically attach to the view.
If you want a Page that contains a player you can open the VideoPage
.
Navigation.PushAsync(new MediaManager.Forms.VideoPage());