eventToStatistics method

FlutterSoundStatistics? eventToStatistics(
  1. Map eventMap
)

Creates a new Statistics instance from event map.

Implementation

FlutterSoundStatistics? eventToStatistics(Map<dynamic, dynamic> eventMap) {
  if (eventMap.isEmpty) {
    return null;
  } else {
    int? executionId = eventMap['executionId'];
    int? videoFrameNumber = eventMap['videoFrameNumber'];
    var videoFps = _doublePrecision(eventMap['videoFps'], 2);
    var videoQuality = _doublePrecision(eventMap['videoQuality'], 2);
    int? time = eventMap['time'];
    int? size = eventMap['size'];
    var bitrate = _doublePrecision(eventMap['bitrate'], 2);
    var speed = _doublePrecision(eventMap['speed'], 2);

    return FlutterSoundStatistics(executionId, videoFrameNumber, videoFps,
        videoQuality, size, time, bitrate, speed);
  }
}