views:

262

answers:

0

Hi,

The situation is as follows: I'm using Windows Media Services 9 to stream my video and I use the latest Silverlight Mediaplayer RadControl from Telerik. At the moment I'm testing it all local host and the streaming server is in the same network, so problems with bandwidth and buffering etc is not the cause. I want to skip my video for one second so I've added a button with the following code behind:

private void StartFragmentRechts_Click(object sender, System.Windows.RoutedEventArgs e) 
    { 
        MediaPlayer.MediaElement.Pause(); 
        TimeSpan huidigetijd; 
        if (TimeSpan.TryParse(StartTijd.Text, out huidigetijd)) 
        { 
            StartTijd.Text = huidigetijd.Add(new TimeSpan(0, 0, 0, 1, 0)).ToString(); 
            MediaPlayer.MediaElement.Position = huidigetijd.Add(new TimeSpan(0, 0, 0, 1, 0)); 
        } 
    } 

Occurring to the following thread: Forward, Rewind Buttons & Methods, this code should do the trick. As you can see, I first pause the video, and I can see in my textbox (StartTijd) that the time is being raised by one second. Also the video that's being showed in the MediaElement skips a second. Unfortunately, when I press play to continue my video, MediaElement.Position jumps with 4 seconds.

I've tried several solutions and all didn't solved the problem:

  1. Replaced "huidigetijd" with MediaPlayer.MediaElement.Position.
  2. Removed MediaPlayer.MediaElement.Pause();
  3. Reproduce the problem with the standard MediaElement which is included in Expression Blend 3.
  4. Instead of using a mms adress as source for my MediaElement, I used a video on my desktop as source. After doing this, the MediaElement position doesn't jump with 4 seconds anymore, and my application works like a charm.

Only solution number 4 gave me a direction where to search. I think the problem is caused by the communication with Windows Media Services 9. Because the 4 second jump doens't show up when I use a local video.

I've searched the internet but couldn't find anything about this strange 4 second jump.

I've been struggling for days now with this problem I've encountered, please help me out.

With kind regards,

Dako