Skip to main content
Home Forums Silverlight Programming Programming with JavaScript Loop video in SplashScreen
6 replies. Latest Post by HarshBardhan on October 9, 2008.
(0)
edu_storm
Member
0 points
5 Posts
10-07-2008 12:01 PM |
Can I put a loop video in a Silverlight splash screen,??
I put one movie but this stoped when finished and the splash continue running.
I would like to know if it is posible to continue showing the loop once this have already finished.
I have already insert the code to the loop, but this do not respond to it.
{
espera.Play();
texmex5
Contributor
2239 points
382 Posts
10-07-2008 12:10 PM |
You could try attatching an eventhandler for mediaended event and in the handler restart the video (espera.play())
<MediaElement MediaEnded="eventhandler" ../>
espera.mediaended += ...
Hope this helps :)
10-07-2008 1:55 PM |
Hi, Thank you!!!
Yes a have this in the splash.XAML <MediaElement x:Name="espera" Width="590" Height="279" MediaEnded="finVideo" Canvas.Left="0" Canvas.Top="0" Source="monito1.WMV" />
and this in te splash.xaml.cs
public splash2() { // Required to initialize variables InitializeComponent(); espera.mediaended += finVideo; } private void finVideo(object sender, RoutedEventArgs e) { // MediaElement espera = (MediaElement)sender; // espera.Position = new TimeSpan(0); espera.Play(); }}
The video play, but the loop dont. Sorry my English , thank youu!!
10-07-2008 3:25 PM |
Eventhandler in XAML
<MediaElement x:Name="espera" MediaEnded="finVideo" Width="100" Height="75"/>
Eventhandler in C#
espera.MediaEnded +=new RoutedEventHandler(finVideo);
Eventhandler:
private void finVideo(object sender, RoutedEventArgs e) { espera.Play(); }
10-07-2008 4:45 PM |
Hi
I can put the video and work fine. But dont make the Loop, maybe dont work on a SPLASH XAML.
Thank you very much!!!
Yi-Lun L...
All-Star
25052 points
2,747 Posts
10-09-2008 1:54 AM |
Hello, in Silverlight, you have to stop a video before you can play it again.
espera.Stop();
HarshBar...
Star
9908 points
1,719 Posts
10-09-2008 2:05 AM |
Hi,
Attach Ended element for your media and call media.Play again in that so when after end it will start again.