printDuration method

Future<void> printDuration()

Implementation

Future<void> printDuration() async {
  var isPlaying = await _mMethodChannelRtmpPlayer?.isPlaying();
  if (isPlaying != null && isPlaying) {
    var duration = await _mMethodChannelRtmpPlayer?.getDuration();
    var currentPosition =
        await _mMethodChannelRtmpPlayer?.getCurrentPosition();
    if (widget.rtmpVideoPlayerProgressChanged != null) {
      widget.rtmpVideoPlayerProgressChanged!(duration, currentPosition);
    }
  }
  if (!mounted) {
    return;
  }
  handleDuration();
}