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?
I’ve posted the link to the answer I provided for you on the Windows Phone Developer Forums so that the community on StackOverflow may find it as well:
http://social.msdn.microsoft.com/Forums/en-US/windowsphone7series/thread/db82a416-8153-436d-99c6-5affd03148ce
Regards,
Richard.