isMuted method

Future<bool?> isMuted()

Checks if the video is currently muted.

Returns true if muted, false if not muted, null on error.

Implementation

Future<bool?> isMuted() async {
  if (_isDisposed) {
    debugPrint('Cannot check mute state: Video renderer is disposed');
    return null;
  }

  try {
    final result = await MethodHandler.invokeNativeMethod(
      'isVideoMuted',
      arguments: {'videoId': videoId},
    );

    if (result is Map) {
      return result['isMuted'] as bool?;
    }
    return null;
  } catch (e) {
    debugPrint('Error checking mute state: $e');
    return null;
  }
}