What's the difference between BufferingStarted and PlaybackSession.BufferingStarted
I'm using UWP
MediaPlayerElement, and set
var mediaPlayer = new MediaPlayer(); viuMediaPlayer.SetMediaPlayer(mediaPlayer); mediaPlayer.BufferingStarted += MediaPlayer_BufferingStarted; mediaPlayer.PlaybackSession.BufferingStarted += PlaybackSession_BufferingStarted;
BufferingStarted event, I found this two both have buffer start event.
Simalarly for events like
PlaybackStateChanged and others.
What is the difference between them?
This duplication is actually caused by the fact that these "duplicated"
MediaPlayerevents are now deprecated. See the documentation for the
BufferingStartedevent for example:
MediaPlayer.BufferingStarted may be altered or unavailable after Windows 10, version 1607. Instead, use the MediaPlayer.PlaybackSession property to get a MediaPlaybackSession object and then use the MediaPlaybackSession.BufferingStarted event.
So you can safely use
MediaPlayer.PlaybackSessioninstead and stay on the safe side with future updates.