Unable to understand the difference bettwen GoToPlaylistItem and GoToPlaylistItemOnNextTick, though GoToPlaylistItemOnNextTick clicked on scenarios where GoToPlaylistItem din’t work.
If you wonder if there are any differences, Have a look at this Post for a problem solved by using GoToPlaylistItemOnNextTick while it was throwing null exception with GoToPlaylistItem
While I naviaged to the defination I got the following details. Could some one explain?
[ScriptableMember]
public virtual void GoToPlaylistItem(int playlistItemIndex);
public void GoToPlaylistItemOnNextTick(int playlistItemIndex);
MediaPlayeruses aTimerinternally. This timer is created in a protected method calledCreatePositionTimer:The method
GoToPlaylistItemOnNextTicksimply sets a few internal variables:The next time the timer comes around,
OnTimerTickis called, and this checks for the above variables and then callsGoToPlaylistItem:So the difference is that
GoToPlaylistItemwill go to the next playlist item immediately, whileGoToPlaylistItemOnNextTickwill do it at the next timer tick. The specific timer it uses isSystem.Windows.Threading.DispatcherTimer. This ensures thatGoToPlaylistItemwill be called when the UI thread is idle.The difference may be significant if you rely on some of the events that
MediaPlayerfires, for exampleStateChanged. If you callGoToPlaylistItem, this event will execute immediately beforeGoToPlaylistItemreturns. If you callGoToPlaylistItemOnNextTick, then the event will only occur later when your current method has finished and the UI thread is idle.