Posted 7 August 2017, 3:59 pm EST
I use a mediaplayer to autoplay a video using this code:
C1MediaItem mi = new C1MediaItem();mi.MediaSource = new Uri(filename, UriKind.RelativeOrAbsolute);
mediaPlayer.AutoPlay = true;mediaPlayer.IsLooping = true;mediaPlayer.Items.Clear();
mediaPlayer.Items.Add(mi);
The graphic shows that it's playing (displaying pause), but video does not play (shows first frame) until unpaused and play is clicked again
If I add this it helps, but not allways for all videos:
Thread thread1 = new Thread(new ThreadStart(() =>{
Thread.Sleep(3000);mediaPlayer.Dispatcher.BeginInvoke(() => mediaPlayer.Play());
}));
thread1.Start();
Maybe adding a MediaIsLoaded event could help?
Another general problem is that the circle can sometimes spin a very long time, and it seems that if I click on the interface (play/pause or circle), I can make it stop spinning and be able to interact with the video.
Thanks
Tom