From 9ef84dd4e277fd335843b3e47d3e6297d4de9521 Mon Sep 17 00:00:00 2001 From: Hiroshi Horie <548776+hiroshihorie@users.noreply.github.com> Date: Fri, 3 Dec 2021 01:01:01 +0700 Subject: [PATCH] no casting required for mute/unmute --- lib/src/publication/local_track_publication.dart | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/lib/src/publication/local_track_publication.dart b/lib/src/publication/local_track_publication.dart index 49d3396..7a4bbd4 100644 --- a/lib/src/publication/local_track_publication.dart +++ b/lib/src/publication/local_track_publication.dart @@ -54,15 +54,9 @@ class LocalTrackPublication extends TrackPublication { @override bool get muted => track?.muted ?? super.muted; - Future mute() async { - if (track is! LocalTrack) return; - // Mute the track associated with this publication - return (track as LocalTrack).mute(); - } + /// Mute the track associated with this publication + Future mute() async => await track?.mute(); - Future unmute() async { - if (track is! LocalTrack) return; - // Unmute the track associated with this publication - return (track as LocalTrack).unmute(); - } + /// Unmute the track associated with this publication + Future unmute() async => await track?.unmute(); }