private async void openFile_Click(object sender, RoutedEventArgs e) { try { var FileOpen = new FileOpenPicker(); FileOpen.SuggestedStartLocation = PickerLocationId.MusicLibrary; FileOpen.FileTypeFilter.Add(".mp3"); FileOpen.FileTypeFilter.Add(".mp4"); FileOpen.FileTypeFilter.Add(".WMA"); var File = await FileOpen.PickSingleFileAsync(); var stream = await File.OpenAsync(Windows.Storage.FileAccessMode.Read); Myplayer.SetSource(stream, File.ContentType); Myplayer.Play(); InitializePropertyValues(); } catch (Exception ex) { MessageDialog message = new MessageDialog("Please select any media file !"); message.ShowAsync(); } }
private void Stop_Click(object sender, RoutedEventArgs e) { Myplayer.Stop(); }
private void Pause_Click(object sender, RoutedEventArgs e) { Myplayer.Pause(); }
private void Play_Click(object sender, RoutedEventArgs e) { Myplayer.Play(); InitializePropertyValues(); }