Video freezes on resetting MediaPlayerElement position

Rose 0 Reputation points

We have developed an application that requires playing a video on a loop all day using mediaplayerelement. In order to ensure the video plays exactly synchronized with our expectations, we reset the position of the video about once every minute or so. We found that otherwise the video becomes out of sync despite being exactly the same length as the videos playing next to it. Intermittently, after a long period with no user interaction, the video will freeze. On checking our internal logs, it appears there is a code hang on resetting the position of the MediaPlayerElement.MediaPlayer.PlaybackSession. We can see a log statement from directly before it attempts, but then the video freezes and the associated SeekComplete event is not called until the next time you interact with the program (could be minutes, could be hours). I have read forums of people noticing this issue when setting the position close to the loop point. We have noticed this issue as well and such take care to always ensure the video is at least 500ms away from either the beginning or end before attempting to reset the position. However, the issue can still occur after running the program for several hours

Universal Windows Platform (UWP)
{count} votes