Skip to main content

Microsoft Silverlight

Answered Question Loop video in SplashScreenRSS Feed

(0)

edu_storm
edu_storm

Member

Member

0 points

5 Posts

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();

texmex5
texmex5

Contributor

Contributor

2239 points

382 Posts

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

 

edu_storm
edu_storm

Member

Member

0 points

5 Posts

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

texmex5
texmex5

Contributor

Contributor

2239 points

382 Posts

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();
}
 
 
 

 

edu_storm
edu_storm

Member

Member

0 points

5 Posts

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

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

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.

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

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
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities