2026-10-11-media-player-state
title: Media controls follow intent and the package confirms played spans affects: dartway_media_flutter: "0.3.0-dev.0"
Who is affected
Projects using dartway_media_flutter, especially copied media chrome or manual played-span observers.
What to change
- Remove
session.playbackObservation,DwMediaObservationHandle,DwMediaObservationResult, and manualrecord/confirmation adapters. KeepplaybackDelivery: the package now supplies played spans automatically and seals them on pause, seek, speed change, source change, error, end and disposal. Remove any position-gap heuristics to avoid counting the same playback twice. - Replace
DwMediaPlayState.bufferingandisBufferingwithstatus.waitingfor a spinner. Draw play/pause fromstatus.intent == DwMediaPlayIntent.playand callsession.togglePlay(); waiting must not change the button or controls timer. - Listen to
session.statusfor controls andsession.positionfor the timeline.session.playbackremains their merged state. Draw a timeline thumb from its active drag, thenseekTarget, then the playback position; callseekbefore clearing the drag on release. - Replace application flags for whether the current item really played with
session.hasReallyPlayed. Playback intent survives a source retry; pause first if the retry should remain paused.
Copy the updated chrome from the framework repository's
example/dartway_example_flutter/lib/ui_kit/3_special/media/ as needed.
How to check
With fake engines, buffer while playing: pause remains available and waiting only shows a spinner. Hold a seek, release the timeline and skip twice: no old position is drawn and two +10 commands land at +20. Check delivered intervals exclude the seek gap; retain the existing pending-report inspection and retry handling.