I know about all rules of uwp file access permissions. and I also know about MostRecentlyUsedList and FutureAccessList ( 1000 limit ) as well.
I am developing a video player app in which I need to create video playlists.
I tried to do it with PlayList class, it works as far as the video files included in playlists are from within "VideoLibrary" hence accessible by the app.
If even one of the files ( picked by the user and then saved in the playlist ) is from a folder which isn't included in video library, then while I try Playlist.LoadAsync(StorageFile) I get an exception of Access Denied //StorageFile here is the .wpl file , or should I say the already saved playlist file.
The PlaylistFile is actually within the VideoLibrary so it is directly accessible by the app, so it loads normally and saved into a StorageFile object normally, but when I supply that object to Playlist.LoadAsync, access is denied, because the video file in that playlist was outside the videolibrary, when my user picked it with fileopenpicker.
So
1. I want to know what can be the solution because I want to include all video files in video library and all those files which user has selected in the past, to be available and use able by the playlists.
2. I can use futureaccesslist to create history for my app ofcourse, but can they be used (tokens) in Playlist class? I think not. because it only accepts Collection of Storage Files. Even if I can use some sort of database approach to achieve a playlist functionality with futureaccesslist tokens, Yes I can do that but it still has limit of 1000
Summary : I need a clean way so that I can use all video files present on my user's system to be available for him to play, add in history and work well with playlist and stuff. without limit of 1000.
Thanks in advance.
**Note : ** maybe I can do it by prompting user to select their whole PC/Root directory for access to whole system? but I dont think that is a good approach also because my uwp app is support to run on all windows 10 devices.
I can use futureaccesslist to create history for my app ofcourse, but can they be used (tokens) in Playlist class?
When we add the file to the FutureAccessList
, then we do not need use the token in the PlayList
. It can read the file by Playlist.LoadAsync and does not throw Access Denied.
As you known, this list can store up to 1000 items and must be maintained by the app. If you want to access more than 1000 files, you should copy the files to the The locations that all apps can access. For example the VideosLibrary, you can File access permissions.