Example #1
0
        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();
            }
        }
Example #2
0
 private void Stop_Click(object sender, RoutedEventArgs e)
 {
     Myplayer.Stop();
 }
Example #3
0
 private void Pause_Click(object sender, RoutedEventArgs e)
 {
     Myplayer.Pause();
 }
Example #4
0
 private void Play_Click(object sender, RoutedEventArgs e)
 {
     Myplayer.Play();
     InitializePropertyValues();
 }