简体   繁体   中英

Windows Store App play any files

I have list of files

  1. D:\\Videos\\Video_1.mp4

  2. \\\\SOME-NETWORK-PC\\Shared\\Video_2.mp4

    ...

I need play files in MediaElement.

MediaElement.Source = new Uri(url from list);
MediaElement.Play();

but I have this error:

MF_MEDIA_ENGINE_ERR_SRC_NOT_SUPPORTED

Default installed in windows 10 "Movies & TV" - can play video from this list.

  1. In Windows Store App user must allow access to file/folder with FileOpenPicker/FolderPicker

  2. After getting StorageFile (PickSingleFileAsync), save to own list and save to FutureAccessList

StorageApplicationPermissions.FutureAccessList.AddOrReplace(ID, StorageFile)
  1. In next time use FutureAccessList
StorageApplicationPermissions.FutureAccessList.GetFileAsync(ID)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM