C# 在Windows phone silverlight 8.1中播放StorageFile中的视频?

C# 在Windows phone silverlight 8.1中播放StorageFile中的视频?,c#,silverlight,video,C#,Silverlight,Video,从手机多媒体资料中选择视频后,如何设置MediaElement的来源 当调试到达指令中时(使用(var isfs=new IsolatedStorageFileStream(video.Path,FileMode.Open,FileAccess.Read,FileShare.Read,isf))生成异常“不允许对IsolatedStorageFileStream执行操作”,我不明白为什么 代码如下: private void btn_Crea_Click(object sender, R

从手机多媒体资料中选择视频后,如何设置MediaElement的来源

当调试到达指令中时(使用(var isfs=new IsolatedStorageFileStream(video.Path,FileMode.Open,FileAccess.Read,FileShare.Read,isf))生成异常“不允许对IsolatedStorageFileStream执行操作”,我不明白为什么

代码如下:

    private void btn_Crea_Click(object sender, RoutedEventArgs e)
    {
        FileOpenPicker openPicker = new FileOpenPicker();           
        openPicker.ViewMode = PickerViewMode.Thumbnail;  
        openPicker.SuggestedStartLocation = PickerLocationId.VideosLibrary;        
        openPicker.ContinuationData["Operation"] = "UpdateVideo";//"UpdateProfilePicture";
        openPicker.FileTypeFilter.Add(".3GP");
        openPicker.FileTypeFilter.Add(".MP4");
        openPicker.FileTypeFilter.Add(".WMV");
        openPicker.FileTypeFilter.Add(".AVI");
        openPicker.FileTypeFilter.Add(".MOV");
        openPicker.FileTypeFilter.Add(".3G2");
        openPicker.PickSingleFileAndContinue();
   }

  public void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
  {
        if ((args.ContinuationData["Operation"] as string) == "UpdateVideo" &&
            args.Files != null &&
            args.Files.Count > 0)
        {
            StorageFile file = args.Files[0];
            Singleton.Instance.video = file;
        }
        NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
  }

  private void addVideo()
  {
        this.video = Singleton.Instance.video;
        Dispatcher.BeginInvoke(() =>
            {
                using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
                { 
                using (var isfs = new IsolatedStorageFileStream(video.Path, FileMode.Open,                      FileAccess.Read, FileShare.Read, isf)) 
                    {
                        this.videoBox.SetSource(isfs);
                    }
                }
            });

}

您是Package.AppxManifest中的声明文件类型吗?