Repository navigation
Fix SEEK events dropped in idle/loading track states #28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
335bc39
26ed48d
6dc74d3
49be3df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,6 +177,15 @@ export function createTrackMachine(initialContext: TrackContext) { | |
| // ----------------------------------------------------------------- | ||
| idle: { | ||
| on: { | ||
| SEEK: [ | ||
| { | ||
| guard: 'isWebAudioOnly', | ||
| actions: ['reportProgress'], | ||
| }, | ||
| { | ||
| actions: ['seekHtml5', 'reportProgress'], | ||
|
Comment on lines
+185
to
+186
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| }, | ||
| ], | ||
| HTML5_ENDED: { | ||
| actions: ['notifyTrackEnded'], | ||
| }, | ||
|
|
@@ -340,6 +349,15 @@ export function createTrackMachine(initialContext: TrackContext) { | |
| // ----------------------------------------------------------------- | ||
| loading: { | ||
| on: { | ||
| SEEK: [ | ||
| { | ||
| guard: 'isWebAudioOnly', | ||
| actions: ['reportProgress'], | ||
| }, | ||
| { | ||
| actions: ['seekHtml5', 'reportProgress'], | ||
|
Comment on lines
+357
to
+358
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
If this loading-state seek occurs before metadata is available, Useful? React with 👍 / 👎. |
||
| }, | ||
| ], | ||
| BUFFER_LOADING: { | ||
| actions: 'setLoadingState', | ||
| }, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
WEBAUDIO_ONLYmode while the track is idle, this branch intentionally skipsseekHtml5, butreportProgresscallstoInfo(), whosecurrentTimegetter returnsaudio.currentTimeoutside thewebaudiostate rather than the newly assignedpausedAtTrackTime. A seek before decoding therefore emits the old position—typically zero—to progress consumers and media-session state even though playback will eventually use the requested anchor. Report the requested anchor directly or make idle/loading Web Audio-only tracks expose it throughcurrentTime.Useful? React with 👍 / 👎.