Pergunta

I'm looking for some help... I'm writing a WPF program that use a MediaElement. I'm setting his position (as an example) to 01:02:15, but the video start playing at 01:02:03 If I'm setting position to 01:02:52 , it'll start playing at 01:02:43

As I see, positions can only be set to XX:XX:03 / XX:XX:23 / XX:XX:43

Have anyone face this problem before ? Or can give me a way to solve it ?

Thank you for all !

MyMediaElement.BeginInit();
MyMediaElement.Stop();
MyMediaElement.Position = new TimeSpan(1, 25, 21);
MyMediaElement.Play();
MyMediaElement.EndInit();

Moreover, as I was debuging the program step by step, I saw that Position is cleany setted, but as I go trought the MyMediaElement.Play() method, Position is resetted to 01:23:00 ...

Foi útil?

Solução

RESOLVED !

The probleme came with the video I was trying to play and position. Something wrong happenned with the video index, then I convert my video to mp4 in order to force reindexation.

Now it works well !!!

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top