PlayerSettings class final State and streams
What the app asked of the player: volume and speed, the effects and the analysis, the output it wants, the network and the media session.
The PlayerState.settings of a player: read it from
player.state.settings, or follow one value through its stream in
player.stream.
Constructors
-
PlayerSettings({double volume = 100.0, bool mute = false, double volumeMax = 130.0, double volumeGain = 0.0, double volumeGainMin = -96.0, double volumeGainMax = 12.0, double rate = 1.0, double pitch = 1.0, bool pitchCorrection = true, Duration audioDelay = Duration.zero, Gapless gapless = Gapless.weak, ReplayGainSettings replayGain = const ReplayGainSettings(), List<
AudioEffect> audioEffects = const [], SpectrumSettings spectrum = SpectrumSettings.defaults, Cover coverArtAuto = Cover.no, bool prefetchPlaylist = false, CacheSettings cache = const CacheSettings(), DemuxerSettings demuxer = const DemuxerSettings(), Duration networkTimeout = const Duration(seconds: 60), bool tlsVerify = false, String tlsCaFile = '', HlsBitrate hlsBitrate = HlsBitrate.max, bool cookies = false, String httpProxy = '', bool audioExclusive = false, bool audioMediaRole = false, Duration audioBuffer = const Duration(milliseconds: 200), bool audioStreamSilence = false, bool audioNullUntimed = false, Set<Spdif> audioSpdif = const <Spdif>{}, int audioSampleRate = 0, Format audioFormat = Format.auto, Channels audioChannels = Channels.auto, String audioClientName = 'mpv_audio_kit', String audioDriver = '', MediaSession? mediaSession}) -
Creates a PlayerSettings; each value defaults to the one of a player
that has loaded nothing.
const
Properties
- audioBuffer → Duration
-
Audio buffer size.
final
- audioChannels → Channels
-
Channel-layout request. Use the named static fields for the common
presets (mono, stereo, 5.1, 7.1, …) or
Channels.custom('…')for any layout string mpv recognises. Setter: Player.setAudioChannels.final - audioClientName → String
-
Audio client name (used by backend drivers like PulseAudio).
final
- audioDelay → Duration
-
Audio delay applied to the output stream, against the playback
clock. Positive values delay the audio; negative values advance it.
final
- audioDriver → String
-
Requested audio output driver ('coreaudio', 'pulse', 'alsa',
'wasapi', etc.), or empty for mpv's automatic choice, which is also
what
setAudioDriver('auto')stores.final -
audioEffects
→ List<
AudioEffect> -
The DSP effects in mpv's
--afchain, as an ordered list applied in order. Set via Player.setAudioEffects (replace) or Player.updateAudioEffects (mapper). Read live via PlayerStream.audioEffects.final - audioExclusive → bool
-
Whether audio exclusive mode is requested. What it does depends on
the driver: see Player.setAudioExclusive.
final
- audioFormat → Format
-
Sample format requested from mpv.
Format.autodefers to mpv's pick; the other variants force a specific bit depth, signedness or planarity. Setter: Player.setAudioFormat.final - audioMediaRole → bool
-
Whether mpv tags the stream's media role as "music" on the OS audio
server (
audio-set-media-role): a role on PulseAudio and PipeWire, a content type on Android. Set via Player.setAudioMediaRole.final - audioNullUntimed → bool
-
Whether the null audio output runs untimed (
ao-null-untimed).final - audioSampleRate → int
-
Target sample rate (0 for auto).
final
-
audioSpdif
→ Set<
Spdif> -
S/PDIF passthrough codecs. Empty set = passthrough disabled.
Apply via Player.setAudioSpdif.
final
- audioStreamSilence → bool
-
Whether to stream silence when nothing is playing.
final
- cache → CacheSettings
-
Cache configuration. Set via Player.setCache.
final
-
Whether mpv's HTTP cookie jar is enabled for network streams
(
cookies). Mirrors mpv's default offalse. Set via Player.setCookies.final - coverArtAuto → Cover
-
Controls whether mpv automatically loads external cover art files.
See Cover for the available variants.
final
- demuxer → DemuxerSettings
-
Demuxer buffering configuration (forward cache cap, seekback cap,
readahead). Set via Player.setDemuxer. Distinct from
NetworkState.demuxerCacheState, which is the live read-only cache
snapshot.
final
- gapless → Gapless
-
Gapless playback mode.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hlsBitrate → HlsBitrate
-
HLS variant-selection policy (
hls-bitrate). Default HlsBitrate.max mirrors mpv. Set via Player.setHlsBitrate.final - httpProxy → String
-
HTTP proxy URL applied to network streams (
http-proxy), or empty string when none is configured. Set via Player.setHttpProxy.final - mediaSession → MediaSession?
-
Active OS media-session config + metadata override, or
nullwhen no media session is currently published to the lockscreen, SMTC or MPRIS. Set via Player.setMediaSession; passnullto disable. See MediaSession for the full field semantics.final - mute → bool
-
Whether the player is muted.
final
- networkTimeout → Duration
-
Network connection timeout. Default 60s mirrors mpv's
--network-timeout=60.final - pitch → double
-
Pitch multiplier. 1.0 = original pitch.
final
- pitchCorrection → bool
-
Whether pitch correction is enabled when changing playback speed.
final
- prefetchPlaylist → bool
-
Whether mpv prefetches the next playlist item in the background.
final
- rate → double
-
Playback speed multiplier. 1.0 = normal speed.
final
- replayGain → ReplayGainSettings
-
ReplayGain configuration. Set via Player.setReplayGain.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- spectrum → SpectrumSettings
-
The configuration of the FFT pipeline behind PlayerStream.fft
(size, bands, window, emit rate, smoothing, dB range). Set via
Player.setSpectrum or Player.updateSpectrum, read live via
PlayerStream.spectrum. Lives on the Dart side only.
final
- tlsCaFile → String
-
Absolute filesystem path to a custom PEM bundle of trusted CA
certificates, or empty string when the built-in roots are used.
final
- tlsVerify → bool
-
Whether to verify TLS/SSL certificates on
https://streams. Mirrors mpv's--tls-verifydefault offalse. Enable via Player.setTlsVerify when a bundled CA is in use.final - volume → double
-
Current soft volume in percent, 0 to 1000. 100 is unity, and values
above it amplify the signal.
final
- volumeGain → double
-
Software volume gain in dB.
final
- volumeGainMax → double
-
mpv's
volume-gain-max, in dB (default +12): the top of mpv's relative steps on the gain, not of Player.setVolumeGain. Set via Player.setVolumeGainMax.final - volumeGainMin → double
-
mpv's
volume-gain-min, in dB (default -96): the floor of mpv's relative steps on the gain, not of Player.setVolumeGain. Set via Player.setVolumeGainMin.final - volumeMax → double
-
mpv's
volume-max, 100 to 1000 (default 130): the top of mpv's relative volume steps and a natural top for a volume slider. It does not cap Player.setVolume.final
Methods
-
copyWith(
{double? volume, bool? mute, double? volumeMax, double? volumeGain, double? volumeGainMin, double? volumeGainMax, double? rate, double? pitch, bool? pitchCorrection, Duration? audioDelay, Gapless? gapless, ReplayGainSettings? replayGain, List< AudioEffect> ? audioEffects, SpectrumSettings? spectrum, Cover? coverArtAuto, bool? prefetchPlaylist, CacheSettings? cache, DemuxerSettings? demuxer, Duration? networkTimeout, bool? tlsVerify, String? tlsCaFile, HlsBitrate? hlsBitrate, bool? cookies, String? httpProxy, bool? audioExclusive, bool? audioMediaRole, Duration? audioBuffer, bool? audioStreamSilence, bool? audioNullUntimed, Set<Spdif> ? audioSpdif, int? audioSampleRate, Format? audioFormat, Channels? audioChannels, String? audioClientName, String? audioDriver, Object? mediaSession = unset}) → PlayerSettings -
Returns a copy with the given fields replaced. Pass
nullfor a nullable field to clear it; omitted fields keep their current value.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited