0

MediaPlayerElement has an event called SeekCompleted, but does not have a SeekStarted event. This is annoying when I click the slider when the network is bad, it seems like the frame is stopped, and MediaPlayerElement returns "PlaybackState: Playing", but actually it's not.

In this video, my network is not good, and from 00:00:06 to 00:00:19, the video frame is stopped and returns "PlaybackState: Playing". this duration depends on the network. Until 00:00:19, it returns "PlaybackState: Buffering".

So how can I set a fake buffering from 00:00:06 to 00:00:19, cause this period to the end-user, itis not playing. Thx.

enter image description here

Vincent
  • 3,124
  • 3
  • 21
  • 40
  • I am not experienced with the `MediaPlayerElement` behavior, but any chance `BufferingProgressChanged` could be used? – Martin Zikmund Jan 23 '21 at 11:01
  • 1
    `BufferingProgressChanged` only fired at the beginning of the play, I just test it. But the official doc says "Occurs when the buffering progress for the MediaPlaybackSession changes." – Vincent Jan 23 '21 at 12:04
  • Could you please tell me if you want an event handler to be triggered when you reset playback progress of a video? – YanGu Jan 26 '21 at 08:46
  • Reset progress event? No. – Vincent Jan 27 '21 at 14:09

1 Answers1

0

I found a solution, from 00:00:06 to 00:00:19 in the video, I can use a Timer, which ticks 1 second, to detect the PlaybackSession.Position.

If the position is the same as the last second, then show a fake buffering.

But we have to consider video pause, so we can use like this.

if(video.state != pause)
{
   if(newPosition == oldPosition)
      ShowBuffer();
}
Vincent
  • 3,124
  • 3
  • 21
  • 40