stopRecordVideo method

Future<int> stopRecordVideo()

录像结束

Implementation

Future<int> stopRecordVideo() async {
  if (_recordCompleter != null) {
    if (_status == MediaStatus.completed) {
      _mediaPlayer.stopRecord(
          msg: SurfaceMessage(playHandle: _playHandle, textureId: textureId));
      _recordCompleter!.complete();
      _notifyCallBacks(null, true, 0);

      return 0;
    }

    final code = await _mediaPlayer.stopRecord(
        msg: SurfaceMessage(playHandle: _playHandle, textureId: textureId));
    _recordCompleter!.complete();
    if (code < 0) {
      _notifyCallBacks(null, false, code);
    } else {
      _notifyCallBacks(null, true, code);
    }
    return code;
  }
  return -1;
}