onStateChanged method
void
onStateChanged(
- void callback(
- PlaybackState oldValue,
- PlaybackState newValue
- bool reply = false,
Set a PlaybackState change callback. https://github.com/wang-bin/mdk-sdk/wiki/Player-APIs#player-onstatechangedstdfunctionvoidstate-cb
Implementation
// reply: true to let native code wait for dart callback result
void onStateChanged(
void Function(PlaybackState oldValue, PlaybackState newValue)? callback,
{bool reply = false}) {
if (callback == null) {
_stateCb.clear();
Libfvp.unregisterType(nativeHandle, 1);
} else {
_stateCb.add(callback);
Libfvp.registerType(nativeHandle, 1, reply);
}
}