private void TryToLoadAndPlay(string uri) { inputURI = uri; VideoBox.SetPlaybackSource(MediaSource.CreateFromUri(new Uri(inputURI))); VideoBox.Play(); //VideoBox.MediaPlayer.MediaFailed += URIMediaFailed; }
private async void picker_Click(object sender, RoutedEventArgs e) { inputFile = await OpenFile.LoadFileAsync(); if (inputFile != null) { VideoBox.SetPlaybackSource(MediaSource.CreateFromStorageFile(inputFile)); //VideoBox.MediaPlayer.RealTimePlayback = true; VideoBox.Play(); //VideoBox.MediaPlayer.MediaFailed += LocalMediaFailed; } }
private async void TryToLoadAndPlay(StorageFile file) { inputFile = file; var stream = await inputFile.OpenAsync(FileAccessMode.Read); VideoBox.SetPlaybackSource(MediaSource.CreateFromStorageFile(inputFile)); VideoBox.Play(); //VideoBox.MediaPlayer.RealTimePlayback = true; //VideoBox.MediaPlayer.Play(); MediaTitleBlock.Text = inputFile.DisplayName; //VideoBox.MediaPlayer.MediaFailed += LocalMediaFailed; }