locked
MediaElement can't play local resources? RRS feed

  • Question

  • Testing out the new windows phone SDK.
    - I have a MediaElement that plays content from an external URI. This works.
    - I add this same resource locally to my application and set it as a "Resource". This does NOT work. I'm not getting any errors, warnings or messages telling me something is wrong.

    I used the exact same technique with a normal Silverlight application and everything worked fine.

    So the Windows Phone can't play local content? Ex: mp3's
    Monday, March 15, 2010 10:35 PM

All replies

  • With the current bits you will have to set up the local media file as "Content", not as "Resource" to make it work.

    Note that this is different from SL3 and it's different from what the tools suggest. We are planning to address this by the final release of Silverlight for Windows Phone. The current limitation stems from the fact that playback from a Stream object is not yet supported.

    Thanks!

    Stefan Wick

    Tuesday, March 16, 2010 1:55 AM
  • Hmmm still not working for me...
    I set my file as "Content" and "Copy always".

    <MediaElement Source="/ASP-winvideo-WhatIsASP_NET.wmv" Width="200" Height="200" AutoPlay="True" />

    This technique DID work for a normal Silverlight application but not my phone app.
    Tuesday, March 16, 2010 9:10 AM
  • Got it working. Thanks.

    I just needed to remove the "/" from my path.
    Tuesday, March 16, 2010 9:21 AM
  • yup worked for me too. many thanks!

    Monday, June 6, 2011 3:42 AM