Skip to content

CarPlay/lock-screen duration is always 0 #6

Description

@SolRaze

NowPlaying.begin is handed a hardcoded duration: 0 (Sources/Core/Player.swift:75) and nothing ever updates track.duration afterwards.

Player.duration is populated from VLC at Sources/Core/Player.swift:115, but it is never propagated into NowPlaying. So publish() writes MPMediaItemPropertyPlaybackDuration = 0 on every update (Sources/Core/NowPlaying.swift:112).

Impact — the car and lock-screen scrubber have no track length. SPEC lists scrubber accuracy as a must-verify item, and README calls NowPlaying.swift "the entire CarPlay surface".

Fix sketch — propagate duration once VLC reports it (it is 0 at load time; VLC only knows the length after parsing). Either pass it on each update(position:playing:) or give NowPlaying a setDuration.

NoteNowPlaying currently has zero test coverage, which is why this shipped unseen. A unit test asserting the published nowPlayingInfo dict carries a non-zero duration would catch it without a car.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions