Reputation: 274
I have an mp3 file included in the Resources folder of my Windows Phone 8 project. The file plays in normal scenarios. However, in case the file is played and stopped many times, it starts giving the following exception when I call MediaPlayer.Play(song):
Song playback failed. Please verify that the song is not DRM protected. DRM protected songs are not supported for creator games.
If I try to access MediaPlayer.State in such a scenario, it gives me the following error:
Value does not fall within the expected range.
Any attempt to play the file after this fails and gives the above error. The file is able to play only after terminating and relaunching the app.
I have also checked the properties of the file and it's protection is Off.
Kindly help me in case any of you have come across the same issue and have a solution for the same.
Thank you
Upvotes: 0
Views: 139
Reputation: 537
Can you try to create MediaPlayer element dynamically?
MediaElement ME = new MediaElement();
ME.Source = new Uri("source of file");
ME.Play();
Upvotes: 1