Page view counter
Loop video in SplashScreen
Last post 10-09-2008 2:05 AM by HarshBardhan. 6 replies.
Sort Posts:
10-07-2008 12:01 PM
Loop video in SplashScreen

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.

I attached the loop code:private void finVideo(object sender, RoutedEventArgs e)

{

MediaElement espera = (MediaElement)sender;

espera.Position = new TimeSpan(0);

espera.Play();

edu_storm

Loading...
Joined on 10-07-2008
Posts 5
10-07-2008 12:10 PM
Re: Loop video in SplashScreen

 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 :) 

 

texmex5

Loading...
Joined on 03-04-2008
Estonia
Posts 375
10-07-2008 1:55 PM
Re: Re: Loop video in SplashScreen

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!!

edu_storm

Loading...
Joined on 10-07-2008
Posts 5
10-07-2008 3:25 PM
Re: Re: Loop video in SplashScreen
  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();
}
 
 
 

 

texmex5

Loading...
Joined on 03-04-2008
Estonia
Posts 375
10-07-2008 4:45 PM
Re: Re: Re: Loop video in SplashScreen

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!!!

edu_storm

Loading...
Joined on 10-07-2008
Posts 5
10-09-2008 1:54 AM
Marked as Answer
Re: Loop video in SplashScreen

Hello, in Silverlight, you have to stop a video before you can play it again.

espera.Stop();

espera.Play();

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

Yi-Lun Luo - MSFT

Loading...
Joined on 10-29-2007
Posts 2,688
10-09-2008 2:05 AM
Re: Video Loop in Splash

Hi,

Attach Ended element for your media and call media.Play again in that so when after end it will start again.

Mark as answer if this post answered your question.

Harsh Bardhan

HarshBardhan

Loading...
Joined on 05-07-2008
Bangalore
Posts 1,161
Microsoft Communities