Search code examples
win-universal-appdirectoryknown-foldersvideo-library

KnownFolders.VideosLibrary picks all videos?


in UWP "knownfolders.VideoLibrary", what exact folders does this pickup ? musiclibrary picks all music present on the hard drive, but VideosLibrary seems to pick only 2 folders on my harddrive which have videos. but there are other folders as well and they are not being picked. here is the code.

var files = await KnownFolders.VideosLibrary.GetFilesAsync(
           Windows.Storage.Search.CommonFileQuery.OrderByDate);

Solution

  • Include the other folders into the Video Library.

    Right Click a folder containing videos -> Include in library -> video.

    You can prompt user to select a folder and add the folder to the video library like this:

    StorageLibrary videoLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Videos);
    await videoLibrary.RequestAddFolderAsync();