Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
 private void Play_Click(object sender, RoutedEventArgs e)
 {
     Myplayer.Play();
     InitializePropertyValues();
 }