MediaPlayer for WinPhone

-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)

c#
windows-phone-8.1
fileopenpicker
asked on Stack Overflow Feb 11, 2016 by Yura Gumenyuk • edited Feb 11, 2016 by Gerald Schneider

1 Answer

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

answered on Stack Overflow Feb 11, 2016 by Gerald Schneider

User contributions licensed under CC BY-SA 3.0