locked
how to getKnownFolders.VideosLibrary real path.

    Question

  • Hello.

    Currently I am making the simple videoplayer that is not NativePlayer and used different framework like (FFMPEG). but I have a simple problem that made a list that can see  local files in video folder ( KnownFolders.VideosLibrary).

    As follows, I made list like this



    fileList = await videosFolder.GetFilesAsync();

    LocalFileListView.ItemsSource = fileManger.Collection;

    but when I click List item (file in VideosLibrary ) , I shoud  give file path to PlayScreenPage. It means My pleayer need absolute filepath... in to Play I need a file path i already tryed like this videosFolder.Path but i think it  is not  clear.

    Thanks for answers in advance.
    Please tell us the understanding tell me. 

    • Edited by derrickboy Tuesday, December 02, 2014 2:13 AM
    Thursday, November 27, 2014 4:07 AM

Answers

  • Alright, I think you may use launcher and you can do something like this as the documentation LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method:

       //file is the one you get from picker
       if (file != null)
       {
          // Set the option to show the picker
          var options = new Windows.System.LauncherOptions();
          options.DisplayApplicationPicker = true;
    
          // Launch the retrieved file
          bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
          if (success)
          {
             // File launched
          }
          else
          {
             // File launch failed
          }
       }
       else
       {
          // Could not find file
       }
    

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 02, 2014 6:11 AM
    Moderator

All replies

  • Hello.

    Currently I am making the simple videoplayer that is not NativePlayer  and used different framework like (ffmpeg).

    but i have a problem ,  made a list that can see  local files in video folder ( KnownFolders.VideosLibrary) .

    As follows, I made  list

    fileList = await videosFolder.GetFilesAsync();

    LocalFileListView.ItemsSource = fileManger.Collection;

    but when I click List item (file in VideosLibrary ) , I shoud  give file path to PlayScreenPage.

    It means My pleayer need absolute filepath... in to Play I need a file path

    i already tryed like this   videosFolder.Path , but i think it  is not  clear.

    Thanks for answers in advance.
    Please tell us the understanding tell me. 




    Thursday, November 27, 2014 2:48 AM
  • Hi superbderrick,

    If I understand correctly of your question, you would like get some path like: C:\Users\username\Videos\ as your full path?

    However I don't think it's a good idea, even you have the absolute path, you cannot find the file, because Windows Store App runs in a sandbox mode, you cannot directly access a file from its absolute path. See this for more information: File access and permissions

    When you have the StorageFile, you can make it as stream and play directly in your player, or try to assign a Windows Store App path with it.

    --James


    <font color="0099FF">&lt;THE CONTENT IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED&gt;</font><br/> Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, November 27, 2014 1:01 PM
    Moderator
  • It is hard to know.
    Friday, November 28, 2014 2:03 AM
  • Thanks James 

    Thanks you for talking the time to answer my questions

     you can make it as stream and play directly in your player, or try to assign a Windows Store App path with it.

    In relation to the part is there  any site  or sample code ? and Currently this app is Window phone 8.1 app . Is it the same way?

    In short I added many video files at VideosLibrary and I shoud pass the file path to external player,

    If I accessed the videofiles in VideosLibrary  shoud i do something? (It meas i hope to read and write  file in VideosLibrary )

    Thanks 

    Derrick




     


    • Edited by derrickboy Saturday, November 29, 2014 8:38 AM
    Saturday, November 29, 2014 8:30 AM
  • Alright, I think you may use launcher and you can do something like this as the documentation LaunchFileAsync(IStorageFile, LauncherOptions) | launchFileAsync(IStorageFile, LauncherOptions) method:

       //file is the one you get from picker
       if (file != null)
       {
          // Set the option to show the picker
          var options = new Windows.System.LauncherOptions();
          options.DisplayApplicationPicker = true;
    
          // Launch the retrieved file
          bool success = await Windows.System.Launcher.LaunchFileAsync(file, options);
          if (success)
          {
             // File launched
          }
          else
          {
             // File launch failed
          }
       }
       else
       {
          // Could not find file
       }
    

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, December 02, 2014 6:11 AM
    Moderator