-1

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)

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78
  • 1
    What's the exception? – Gerald Schneider Feb 11 '16 at 10:46
  • this code var selectedFiles = await openPicker.PickMultipleFilesAsync(); and ex 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) – Yura Gumenyuk Feb 11 '16 at 10:49
  • "The request is not supported" - sounds like you can't open a file picker. – ChrisF Feb 11 '16 at 10:52
  • According to [the documentation](https://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.pickers.fileopenpicker.pickmultiplefilesasync.aspx) `FileOpenPicker.PickMultipleFilesAsync` is not implemented in Windows Phone 8 API, you need at least Windows 10 to be able to use it. – Gerald Schneider Feb 11 '16 at 10:53
  • maybe you know some methods to open multiple files? – Yura Gumenyuk Feb 11 '16 at 10:56

1 Answers1

0

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

Gerald Schneider
  • 17,416
  • 9
  • 60
  • 78