closeAsync method
Close the player asynchronously.
closePictureInPicture controls whether the associated PiP session
should be terminated. Defaults to true to preserve existing behavior.
Implementation
Future<void> closeAsync({bool closePictureInPicture = true}) async {
_playerIsCreated = false;
TTFLogger.i(_logTag, 'closeAsync: hasCode: $hashCode');
_clearEvent();
_seekCompletedCallbacks.remove(hashCode);
_seekRenderCompletedCallbacks.remove(hashCode);
_getHlsStreamInfosCallbacks.remove(hashCode);
_selectHlsVideoStreamCallbacks.remove(hashCode);
_selectHlsRenditionCallbacks.remove(hashCode);
_seekSerialNo = 0;
await engineInstanceMethodChannel.invokeMethod(
'closeAsync', closePictureInPicture);
}