toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  validate();
  return <String, Object?>{
    'playerId': playerId,
    'kind': kind.wireName,
    'status': status.name,
    'positionMs': position.inMilliseconds,
    if (duration != null) 'durationMs': duration!.inMilliseconds,
    'bufferedMs': buffered.inMilliseconds,
    'volume': volume,
    'speed': speed,
    'muted': muted,
  };
}