IosAudioOptions.fromMap constructor
IosAudioOptions.fromMap(
- Map map
Creates options from a serialized map.
Implementation
factory IosAudioOptions.fromMap(Map<dynamic, dynamic> map) {
return IosAudioOptions(
category: _enumValue(
IosAudioSessionCategory.values,
map['category'],
IosAudioSessionCategory.playAndRecord,
),
mode: _enumValue(
IosAudioSessionMode.values,
map['mode'],
IosAudioSessionMode.defaultMode,
),
allowBluetooth: map['allowBluetooth'] as bool? ?? true,
allowAirPlay: map['allowAirPlay'] as bool? ?? true,
mixWithOthers: map['mixWithOthers'] as bool? ?? false,
defaultToSpeaker: map['defaultToSpeaker'] as bool? ?? true,
preferredSampleRate: (map['preferredSampleRate'] as num?)?.toDouble(),
preferredBufferDuration:
(map['preferredBufferDuration'] as num?)?.toDouble(),
);
}