PlaybackConfig.fromJson constructor

PlaybackConfig.fromJson(
  1. Object? raw
)

Implementation

factory PlaybackConfig.fromJson(Object? raw) {
  if (raw is! Map) return defaults;
  final multiplier = raw['speedMultiplier'];
  return PlaybackConfig(
    autoPlay: raw['autoPlay'] == true,
    loop: raw['loop'] == true,
    speedMultiplier: (multiplier is num && multiplier > 0)
        ? multiplier.toDouble()
        : 1.0,
  );
}