MediaPlayer for WinPhone

44 views Asked by At

I'm trying to create some mediaplayer, but stacked on this moment. Need to add some files to my playlist, but it throw an exception... Here's code

private async void Open_OnClick(object sender, RoutedEventArgs e)
        {
            var openPicker = new FileOpenPicker
            {
                ViewMode = PickerViewMode.Thumbnail,
                SuggestedStartLocation = PickerLocationId.PicturesLibrary
            };
            openPicker.FileTypeFilter.Add(".mp3");
            var selectedFiles = await openPicker.PickMultipleFilesAsync();
            if (selectedFiles != null)
            {
                foreach (StorageFile file in selectedFiles)
                {
                    Playlist.Add(file.Path);
                }
            }

        }

The exception

An exception of type 'System.Exception' occurred in MediaPlayer.exe but was not handled in user code Additional information: The request is not supported. (Exception from HRESULT: 0x80070032)

1

There are 1 answers

0
Gerald Schneider On BEST ANSWER

According to the documentation FileOpenPicker.PickMultipleFilesAsync() is not implemented in Windows Phone 8 API, you need at least Windows 10 to be able to use it.

Requirements (Windows 8.x and Windows Phone 8.x)
Minimum supported phone: None supported