isPlayingStateChangeAllowed property

bool isPlayingStateChangeAllowed
getter/setter pair

A flag to prevent changes to state.playing due to loadfile commands in open.

By default, MPV_EVENT_START_FILE is fired when a new media source is loaded. This event modifies the state.playing & stream.playing to true.

However, the Player is in paused state before the media source is loaded. Thus, state.playing should not be changed, unless the user explicitly calls play or playOrPause.

We set isPlayingStateChangeAllowed to false at the start of open to prevent this unwanted change & set it to true at the end of open. While isPlayingStateChangeAllowed is false, any change to state.playing & stream.playing is ignored.

Implementation

bool isPlayingStateChangeAllowed = false;