locked
MediaElement can't open a file using a stream

    Question

  • Good Evening (I hope this is not OT) I have a great problem: it is possible to open a video with MediaElement from a folder on my computer (such as a Removable Storage) without using a Picker? I know the path and I open a stream based on that path, but the access is denied... How can I do this?

    Thanks to everyone!


    • Edited by 3rr3 Tuesday, November 20, 2012 7:12 PM
    Tuesday, November 20, 2012 7:02 PM

All replies

  • you cant. you will need the picker or the file have to be in the music library

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, November 20, 2012 7:14 PM
  • It's a video what I want to open, but there will be a method to remember the permission given to the Picker... The Video app can do something like this...
    Tuesday, November 20, 2012 7:25 PM
  • Yes, I also want to do this; I can't believe it only works from the music library and not others, surely this is possible!?
    Tuesday, November 20, 2012 7:27 PM
  • I hope that it's possible because videos are usually stored on removable disk... And I want to play them with my app...
    Tuesday, November 20, 2012 7:30 PM
  • you can remember the permission with this namespace: http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.accesscache.aspx

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Tuesday, November 20, 2012 8:51 PM
  • So it is possible to get the access to file into a specified folder?
    Wednesday, November 21, 2012 5:58 PM
  • if the user gived it to you with a file picker yes, then you can cache the access but the user will first have to allow you with the file picker

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Wednesday, November 21, 2012 7:06 PM
  • If we - the app - download the file on behalf of the user (into the Videos library) and add the reference to a FutureAccess list that should work too right?

    I'm not clear if the FutureAccess list is serialisable though so we can restore our access rights on each launch.

    Any thoughts?

    -- I guess 3rr3 and I are trying to avoid having to bug the user each time for access to files we know they want.


    • Edited by MrChris2000 Thursday, November 22, 2012 6:11 AM
    Thursday, November 22, 2012 6:10 AM
  • Hypotesis: I'm working on a XML. It contains the paths of my films. How can I do to play them without using the picker?
    Thursday, November 22, 2012 9:03 AM