WinPhone 媒体播放器
MediaPlayer for WinPhone
我正在尝试创建一些媒体播放器,但此时已堆叠。需要将一些文件添加到我的播放列表,但它抛出异常...这是代码
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);
}
}
}
异常
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)
根据文档 FileOpenPicker.PickMultipleFilesAsync()
未在 Windows Phone 8 API 中实现,您至少需要 Windows 10 才能使用它。
Requirements (Windows 8.x and Windows Phone 8.x)
Minimum supported phone: None supported
我正在尝试创建一些媒体播放器,但此时已堆叠。需要将一些文件添加到我的播放列表,但它抛出异常...这是代码
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);
}
}
}
异常
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)
根据文档 FileOpenPicker.PickMultipleFilesAsync()
未在 Windows Phone 8 API 中实现,您至少需要 Windows 10 才能使用它。
Requirements (Windows 8.x and Windows Phone 8.x)
Minimum supported phone: None supported