I have a problem, I have written a simple Media Player for Windows Phone 7 and can Play, Stop and control the Volume of a Video (loaded from a URI) however when I try to set the position, this causes the application to freeze.
I have used both these lines, but either does not work:
Player.Position = new TimeSpan(0, 0, 0, 0, (int)Position.Value);
Player.Position = TimeSpan.FromSeconds((int)(Position.Value));
I do have this event handler:
void Player_MediaOpened(object sender, RoutedEventArgs e)
{
Position.Maximum = Player.NaturalDuration.TimeSpan.TotalMilliseconds;
}
And have tried using the Seconds value, casting to Ints etc, however everytime I try to set the Position, the app freezes. The video otherwise plays normally - anyone know what the problem may be here?