Looping a media element in Expression blend
-
Friday, August 10, 2007 11:16 AM
Hi guys. is there a way to do this?
thanks a million
chad
All Replies
-
Saturday, August 11, 2007 1:22 PM
I had this same problem as well.
Unfortunately there is no MediaTimeline and RepeatBehavior="Forever" in Silverlight (as you would use in WPF.
However what you can do is hook in the media ended event, and call play on your media element.
For Example:
protected void myMediaElement_MediaEnded(object sender, EventArgs args){
// Replay the video MediaElement video = (MediaElement)sender;video.Position = new TimeSpan(0);video.Play();
}
If this has answered your question, please hit the Mark as Answered thingy.
-
Sunday, August 12, 2007 1:17 AM
hi..
thanks for the reply.
was just wondering where do i go about putting the codes?
is it in the .js file?
thanks again=)
-
Sunday, August 12, 2007 4:36 AMYes, the code goes in your JS file, but please note that you will need wire the MediaEnded event to the method that will start the next media. You can either do it in your XAML or JS code.
-
Friday, September 30, 2011 8:00 AM
Hi basically this was the answer i was looking for, Thanks! :)
P.S sorry i couldn't fint the plpace where to mark "as answered".

