startDevRecordByTime method

Future<int> startDevRecordByTime({
  1. CardRecordByTime? record,
})

开启回放 起流 record 默认不传,使用 Controller 中的 record 若record不为null.说明是切换了时间. 先关闭当前媒体资源,再重新起流. View不重新创建. 如果当天不存在录像,可以仍然可以调用此方法,record传入 null MediaPlayer将会展示 EmptyBuilder

Implementation

Future<int> startDevRecordByTime({CardRecordByTime? record}) async {
  _setMediaResource(record);
  if (record == null) {
    return -1;
  }
  this.record = record;
  //存在播放器
  if (_playHandle > 0) {
    await stop();
  }

  if (_disposed) {
    return -1;
  }
  _createdSurface = await _mediaPlayer.create(msg: _createMessage());
  _onCreate();
  return _playHandle;
}