PlayerConfiguration class

Build-time configuration for a Player — the set-once choices applied before / at mpv_initialize.

The split is grounded in mpv's own option model: an option mpv applies reactively at runtime (one carrying an UPDATE_* flag — volume, audio-client-name, the audio driver, …) is exposed as a setX(...) method, not duplicated here. This class holds the set-once consumer choices read at use-time (the resume policy, the watch-later dir) plus the initial value of the few runtime properties whose starting state matters before the first setX can land (initialVolume, logLevel). The audio-only library invariants (video / scripting disabled, …) are fixed and deliberately not configurable.

Constructors

PlayerConfiguration({bool autoPlay = false, double initialVolume = 100.0, LogLevel logLevel = LogLevel.warn, bool resumePlayback = true, String? watchLaterDir, bool forceSeekable = false, HlsBitrate hlsBitrate = HlsBitrate.max, bool normalizeDownmix = false, String? demuxerCacheDir})
Creates a configuration; every field defaults to its documented value.
const

Properties

autoPlay bool
If true, playback starts automatically as soon as a track finishes loading. Default: false.
final
demuxerCacheDir String?
Directory for the on-disk demuxer cache (mpv's --demuxer-cache-dir), the companion of CacheSettings.onDisk. null uses mpv's default location (often not writable on mobile) — point this at an app-writable path (e.g. getTemporaryDirectory()) when spilling the cache to disk.
final
forceSeekable bool
Force in-cache seeking on streams mpv reports as non-seekable (mpv's --force-seekable). Read at demux open, so it governs every subsequent load. Default false. Useful to keep the scrub bar live on direct-HTTP / HLS audio that doesn't advertise seeking.
final
hashCode int
The hash code for this object.
no setterinherited
hlsBitrate HlsBitrate
Which HLS variant mpv selects from an adaptive master playlist (mpv's --hls-bitrate). Read at stream open. Default HlsBitrate.max (mpv's default). Set HlsBitrate.min to save bandwidth on metered links.
final
initialVolume double
Initial volume level (0–100). Default: 100.
final
logLevel LogLevel
Threshold forwarded to the Player.stream.log stream.
final
normalizeDownmix bool
Loudness-normalize surround content downmixed to fewer channels (mpv's --audio-normalize-downmix). Read when the resampler is built. Default false (mpv's default): off risks clipping on 5.1→stereo, on may sound quieter. Enable for 5.1 music played on stereo output.
final
resumePlayback bool
Whether to resume playback from the saved "watch later" position when a previously-played file is opened again (mpv's --resume-playback). Default true (mpv's default). Resume only happens once a config has been written via Player.writeResumeConfig; until then this is inert.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
watchLaterDir String?
Directory where the "watch later" resume configs are stored (mpv's --watch-later-dir). null uses mpv's default location, which is often not writable on mobile — point this at an app-writable path (e.g. from getApplicationSupportDirectory()) when using resume there.
final

Methods

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