muteUnmute method

Future<Map<String, dynamic>?> muteUnmute()

Toggles mute/unmute state of the video.

Returns a Map with success status and the new mute state.

Implementation

Future<Map<String, dynamic>?> muteUnmute() async {
  if (_isDisposed) {
    debugPrint('Cannot toggle mute: Video renderer is disposed');
    return null;
  }

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

    if (result is Map) {
      return Map<String, dynamic>.from(result);
    }
    return null;
  } catch (e) {
    debugPrint('Error toggling mute: $e');
    return null;
  }
}