FileState class final State and streams

What mpv read from the current file: its tags, tracks, chapters, cover, format and paths. Reset when nothing is loaded.

The PlayerState.file of a player: read it from player.state.file, or follow one value through its stream in player.stream.

Constructors

FileState({Map<String, String> metadata = const <String, String>{}, Map<String, String> chapterMetadata = const <String, String>{}, List<Chapter> chapters = const <Chapter>[], List<MpvTrack> tracks = const <MpvTrack>[], MpvTrack? currentAudioTrack, AudioParams audioParams = const AudioParams(), double? audioBitrate, CoverArt? coverArt, String mediaTitle = '', String fileFormat = '', int fileSize = 0, String path = '', String filename = '', String streamPath = '', String streamOpenFilename = '', String playlistPath = '', String currentDemuxer = '', Duration demuxerStartTime = Duration.zero})
Creates a FileState; each value defaults to the one of a player that has loaded nothing.
const

Properties

audioBitrate → double?
Current audio bitrate in bps. null if unavailable.
final
audioParams → AudioParams
Audio format parameters from the decoder (track source).
final
chapterMetadata → Map<String, String>
Tag dictionary for the active chapter (per-chapter metadata). Empty when no chapter is active or the file has no chapter tags. Mirrors mpv's chapter-metadata. Distinct from metadata (file level) and from Chapter.title (chapter list, just the title).
final
chapters → List<Chapter>
Chapters in the current file (audiobook or podcast markers). Empty list when the file carries no chapter table.
final
coverArt → CoverArt?
Embedded cover art of the currently loaded track, or null when the file has no embedded picture. Refreshes on every file load, and goes to null first when Player.open, Player.openAll or Player.openPlaylistFile returns. Read live via PlayerStream.coverArt.
final
currentAudioTrack → MpvTrack?
The single audio track currently selected for output, or null when audio is muted at the track level. Distinct from tracks, which lists every track the demuxer surfaced. Mirrors mpv's current-tracks/audio.
final
currentDemuxer → String
Name of the demuxer in use (e.g. mkv, lavf, mp3). Empty when no file is loaded. Mirrors mpv's current-demuxer.
final
demuxerStartTime → Duration
Initial timestamp offset of the current file, as reported by the demuxer. Useful when the container's first frame isn't at zero (chapter-skipped files, edited cuts). Mirrors mpv's demuxer-start-time.
final
fileFormat → String
Container format (e.g. mp4, m4a, flac, mp3). Comma-separated list when the demuxer matches multiple formats.
final
filename → String
File name only (no directory) of the current file. Mirrors mpv's filename. Empty when no file is loaded.
final
fileSize → int
Total stream size in bytes. Zero when unknown (live streams).
final
hashCode → int
The hash code for this object.
no setterinherited
mediaTitle → String
Display name for the current track. Falls back to the file name when no title tag is available. Mirrors mpv's media-title.
final
metadata → Map<String, String>
Dictionary of tags (metadata) for the current track (e.g. Title, Artist).
final
path → String
Full path or URI of the current file as canonicalized by mpv after any redirect. Empty when no file is loaded. Mirrors mpv's path.
final
playlistPath → String
Source playlist of the current entry (playlist-path): the original .m3u or .pls path it was expanded from. Empty when the current file was not loaded via a playlist.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
streamOpenFilename → String
URI of the current file as actually opened post-redirect. Identical to streamPath when no on_load hook rewrote the URL. Mirrors mpv's stream-open-filename.
final
streamPath → String
URI of the current file as originally requested, before any redirect from on_load hooks or protocol resolution. Mirrors mpv's stream-path. Empty when no file is loaded.
final
tracks → List<MpvTrack>
All tracks reported by mpv for the current file (audio, video, embedded picture, …). Filter by MpvTrack.type for a typed "audio tracks only" view; switch via Player.setAudioTrack.
final

Methods

copyWith({Map<String, String>? metadata, Map<String, String>? chapterMetadata, List<Chapter>? chapters, List<MpvTrack>? tracks, Object? currentAudioTrack = unset, AudioParams? audioParams, Object? audioBitrate = unset, Object? coverArt = unset, String? mediaTitle, String? fileFormat, int? fileSize, String? path, String? filename, String? streamPath, String? streamOpenFilename, String? playlistPath, String? currentDemuxer, Duration? demuxerStartTime}) → FileState
Returns a copy with the given fields replaced. Pass null for 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