How can I play videos without using OpenAsync?(MediaElement) RRS feed

  • Question

  • I want to set MediaElement.Source with Uri to a videos in video library.

    But I failed. I look up some threads and one mentioned I can't use a path like  c:\path1\path2\file.mp3.

    For some reason, I don't want to use OpenAsync method to play videos.

    Is there a way to play a video, if I can get a path of that video or the video's info?

    Friday, June 8, 2012 10:41 AM


  • You can't use a path that your app doesn't have access to.

    Metro style apps don't have direct access to the file system outside of their application data and install directories. They can only access files there indirectly by getting a StorageFile or StorageFolder which can provide a stream read in through a broker process which has the user's full access.


    • Marked as answer by Daniel-Yang Monday, June 11, 2012 2:27 AM
    Friday, June 8, 2012 3:49 PM