public TestOverlayPage5() { Label label = null; Content = new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { (label = new Label { Text = "Content area", VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, }) } }; var myUri = new Uri("http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)"); var noDRMSource = MediaSource.FromUri(new Uri("https://bitdash-a.akamaihd.net/content/sintel/sintel.mpd")); bool isFirstRun = true; var drmSource = new DRMMediaSource { Uri = myUri, LicenseUrl = "http://playready-testserver.azurewebsites.net/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1", }; var player = new MediaPlayer { Source = drmSource, VideoOutput = this, UsesEmbeddingControls = false, AutoPlay = true }; player.PlaybackStarted += (s, e) => { if (isFirstRun) { isFirstRun = false; player.Stop(); player.Source = noDRMSource; player.Start(); } }; label.SetBinding(Label.TextProperty, new Binding("Duration", source: player, stringFormat: "{0} duration")); }
public TestOverlayPage4() { Label label = null; Content = new StackLayout { VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Children = { (label = new Label { Text = "Content area", VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, }) } }; var myUri = new Uri("http://profficialsite.origin.mediaservices.windows.net/c51358ea-9a5e-4322-8951-897d640fdfd7/tearsofsteel_4k.ism/manifest(format=mpd-time-csf)"); var DRMSource = new DRMMediaSource { Uri = myUri, LicenseUrl = "http://playready-testserver.azurewebsites.net/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1", }; var player = new MediaPlayer { IsLooping = true, Source = DRMSource, VideoOutput = this, AutoPlay = true, UsesEmbeddingControls = false, }; label.SetBinding(Label.TextProperty, new Binding("Duration", source: player, stringFormat: "{0} duration")); }