muteVideo method

void muteVideo()

Mute story video

Implementation

void muteVideo() {
  final StoryElement? videoElement = assets.value.firstWhereOrNull(
    (StoryElement element) => element.type == ItemType.video,
  );

  if (videoElement != null) {
    if (videoElement.videoController!.isVideoMuted) {
      videoElement.videoController!.unmuteVideo();
      videoElement.isVideoMuted = false;
    } else {
      videoElement.videoController!.muteVideo();
      videoElement.isVideoMuted = true;
    }
  }
}