locked
Delay the Playing of a video using mediaelement RRS feed

  • Question

  • Hi there,

    I am doing an animation in Silverlight 3.0 using Blend 3.0 that requires a video to be played about 6 seconds after the animation starts. The animation starts with some images that move on the screen which works well. The mediaelement window then becomes visable and the video is suppose to start. I have tried playing with "autoplay" but the video either starts at time 0 (when it is true), or not at all when I toggle it from false to true using keyframes.  

    Any ideas on how to acheive this?

    Thanks

    BassMoss
    Sunday, March 7, 2010 4:19 AM

All replies

  • Hi BassMoss,

    In fact I consider that the video is just time line, because it play as any animation with time line, so.. you can control it by opening it's time line, you will find the video as animation in this time you be able to drag the video and shift it to any time that you want "6 seconds".

    I answered as my understanding, if I have any miss please clear it for me.

    -------
    Mohamed Sabry
    Sunday, March 7, 2010 2:28 PM
  • Thanks for the reply Mohamed,

    I'm not sure how to get to the "timeline" of the video. Do you mean loading it into Expression Encoder and put a blank segment in to fill up the 6 seconds or is there some way of getting to the video timeline in Blend? Putting in the "blank video" would increase the file size of the video.

    Thanks again,

    BassMoss

    Sunday, March 7, 2010 11:21 PM
  • If you don't mind writing a short bit of code and are using storyboards:

    public partial class MainPage : UserControl
    	{
    		public MainPage()
    		{
    			// Required to initialize variables
    			InitializeComponent();
    			var sb = this.Resources["PlayAnimationStoryboard"] as System.Windows.Media.Animation.Storyboard;
    			if (sb!=null)
    			{
    				sb.Completed += new System.EventHandler(sb_Completed);
    			}
    		}
    
    		private void sb_Completed(object sender, System.EventArgs e)
    		{
    			this.MyMedia.Play();
    		}
    	}

    Monday, March 8, 2010 3:33 PM
    Moderator