MediaElement won't play after returning from multitasking


  • I have a simple app that plays a media element that I declare and give source to in the MainPage.xaml file. A bug I have noticed is after leaving the app and returning, the media element no longer plays. The function that triggers it is in the MainPage.xaml.cs and I have set up markers to verify the function is being called and executing correctly. For some reason, the media element is simply not playing.

    I am using the .Play() function, and it works with no errors as long as I don't navigate out of the app. Any ideas?

    Friday, February 28, 2014 6:40 AM

All replies

  • how you calling the play button? to you set the source before? then you need to wait till the is loaded (CurrentStateChanged).

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Friday, February 28, 2014 7:58 AM
  • In the MainPage xaml I am setting the source, a direct path, not an object or reference. I have a function that plays the sound with the .Play() function and increments a counter. I know the function is being called because the counter is incremented.
    Sunday, March 2, 2014 7:19 AM
  • Hi,

    There is not enough information to detect why the problem occur in your app. And I cannot reproduce the problem. Would you mind sharing a simple project to skyDrive so that we can test it.

    Best Wishes!

    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. 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, March 6, 2014 6:42 AM
  • A little more info abt ur problem with some codes will be helpful.. I'm also working on the same topic, so may be I can help u..
    Thursday, March 6, 2014 4:47 PM