private void CreatePlaylist() { var playlistItem = new Core.Media.PlaylistItem(); playlistItem.MediaSource = new Uri("http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest"); playlistItem.DeliveryMethod = DeliveryMethods.AdaptiveStreaming; var region = new CaptionRegion(); playlistItem.Captions.Add(region); var caption1 = new CaptionElement { Begin = TimeSpan.Zero, End = TimeSpan.FromSeconds(10), Content = "This marker should display from 00:00:00 to 00:00:10 and the text should be red." }; caption1.Style.Color = Colors.Red; caption1.Style.FontSize.Unit = LengthUnit.Pixel; caption1.Style.FontSize.Value = 15; region.Children.Add(caption1); var caption2 = new CaptionElement { Begin = TimeSpan.FromSeconds(20), End = TimeSpan.FromSeconds(30), Content = "This marker should display from 00:00:20 to 00:00:30 and the text should be yellow." }; caption2.Style.Color = Colors.Yellow; caption2.Style.FontSize.Unit = LengthUnit.Pixel; caption2.Style.FontSize.Value = 15; region.Children.Add(caption2); player.Playlist.Add(playlistItem); }
private void btnOpenFile_Click(object sender, RoutedEventArgs e) { var openFileDialog = new OpenFileDialog(); var result = openFileDialog.ShowDialog(); if (result.Value) { var playlistItem = new Core.Media.PlaylistItem(); playlistItem.StreamSource = openFileDialog.File.OpenRead(); player.Playlist.Add(playlistItem); player.Play(); } }
private void btnOpenFile_Click(object sender, RoutedEventArgs e) { var openFileDialog = new OpenFileDialog(); var result = openFileDialog.ShowDialog(); if (result.Value) { var playlistItem = new Core.Media.PlaylistItem(); playlistItem.StreamSource = openFileDialog.File.OpenRead(); player.Playlist.Add(playlistItem); player.Play(); } }
private void CreatePlaylist() { var playlistItem = new Core.Media.PlaylistItem(); playlistItem.MediaSource = new Uri("http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/elephantsdream/Elephants_Dream_1024-h264-st-aac.ism/manifest"); playlistItem.DeliveryMethod = DeliveryMethods.AdaptiveStreaming; var region = new CaptionRegion(); playlistItem.Captions.Add(region); var caption1 = new CaptionElement { Begin = TimeSpan.Zero, End = TimeSpan.FromSeconds(10), Content = "This marker should display from 00:00:00 to 00:00:10 and the text should be red." }; caption1.Style.Color = Colors.Red; caption1.Style.FontSize.Unit = LengthUnit.Pixel; caption1.Style.FontSize.Value = 15; region.Children.Add(caption1); var caption2 = new CaptionElement { Begin = TimeSpan.FromSeconds(20), End = TimeSpan.FromSeconds(30), Content = "This marker should display from 00:00:20 to 00:00:30 and the text should be yellow." }; caption2.Style.Color = Colors.Yellow; caption2.Style.FontSize.Unit = LengthUnit.Pixel; caption2.Style.FontSize.Value = 15; region.Children.Add(caption2); player.Playlist.Add(playlistItem); }