isPlaying method
Checks if the video is currently playing.
Returns true if playing, false if not playing, null on error.
Implementation
Future<bool?> isPlaying() async {
if (_isDisposed) {
debugPrint('Cannot check playing state: Video renderer is disposed');
return null;
}
try {
final result = await MethodHandler.invokeNativeMethod(
'isVideoPlaying',
arguments: {'videoId': videoId},
);
if (result is Map) {
return result['isPlaying'] as bool?;
}
return null;
} catch (e) {
debugPrint('Error checking playing state: $e');
return null;
}
}