0

In windows phone 7 ..when using the element mediaelement.

I set the source of the mediaelement using url as follows at each time the user clicks on a button:

myMediaElement.Source = new Uri(url, UriKind.Absolute);

then I play it.

when the user clicks the second time on a button .. the mediaElement doesn't work.. Why?

Developer
  • 1,803
  • 2
  • 15
  • 26

2 Answers2

3

You can try

   myMediaElement.Stop();
   myMediaElement.Source = null; 
   myMediaElement.Source = new Uri(url, UriKind.RelativeOrAbsolute);

But I am not sure what you are upto until you post some code of what you are doing.

Lloyd Powell
  • 18,270
  • 17
  • 87
  • 123
nucleons
  • 742
  • 5
  • 21
0

Use AutoPlay to stop Automatic play

        myMediaElement.Source = new Uri("Your Url", UriKind.Absolute);

        myMediaElement.AutoPlay = false;

Now Perform play() on click

Abhishek
  • 995
  • 13
  • 28