Skip to content

Conversation

@bmartel
Copy link
Contributor

@bmartel bmartel commented May 27, 2025

Previously we were not syncing when a media source would buffer, which led to out of sync audio and video in many cases, especially in spotty network conditions or with very large file sizes. This addresses that issue by syncing buffering state events into SyncManager, and handling the state in the particular cases Audio, Video, Paragraphs. Also updated and aligned the buffering visuals by moving that into the TimelineControls.

This video showcases a ~300MB video throttled to 3G then seeked and played, and later unthrottled to simulate what was previously causing media sources to go out of sync with one another:

Kapture.2025-05-28.at.08.47.55.webm

Feature Flag:

  • Added a new feature flag FF_SYNCED_BUFFERING to enable synchronized media buffering across components. (web/libs/core/src/lib/utils/feature-flags/flags.ts)

UI Updates:

  • Introduced a visual buffering indicator in the Timeline component's controls, including new SCSS styles and animations. (web/libs/editor/src/components/Timeline/Controls.scss) [1] [2]
  • Updated the VideoCanvas component to conditionally display a buffering indicator based on the buffering state. (web/libs/editor/src/components/VideoCanvas/VideoCanvas.scss, web/libs/editor/src/components/VideoCanvas/VideoCanvas.tsx) [1] [2]

Synchronized Buffering Logic:

  • Added a useSyncedBuffering hook to manage synchronized buffering states across components using Jotai atoms. (web/libs/editor/src/hooks/useSyncedBuffering.ts)
  • Updated the VideoCanvas and Html5Player components to utilize the synchronized buffering logic, including debounced state updates and conditional behavior based on the feature flag. (web/libs/editor/src/components/VideoCanvas/VideoCanvas.tsx, web/libs/editor/src/lib/AudioUltra/Controls/Html5Player.ts) [1] [2]

Playback Logic Enhancements:

  • Modified the Player class to include a buffering property and handle buffering events (canplay and waiting) with debounced updates. (web/libs/editor/src/lib/AudioUltra/Controls/Player.ts) [1] [2]
  • Adjusted the Timeline and VideoCanvas components to propagate buffering states through their props and interfaces. (web/libs/editor/src/components/Timeline/Types.ts, web/libs/editor/src/components/Timeline/Timeline.tsx) [1] [2]

These changes collectively improve the user experience by providing better visual feedback during buffering and ensuring consistent playback behavior across components.

@bmartel bmartel requested review from a team, Gondragos, hlomzik and nick-skriabin as code owners May 27, 2025 15:18
@netlify
Copy link

netlify bot commented May 27, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 4a4ed26
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/68a3581079cc9900084e32b8

@netlify
Copy link

netlify bot commented May 27, 2025

Deploy Preview for label-studio-storybook ready!

Name Link
🔨 Latest commit 4a4ed26
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/68a358101514690008796690
😎 Deploy Preview https://deploy-preview-7633--label-studio-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the fix label May 27, 2025
@netlify
Copy link

netlify bot commented May 27, 2025

Deploy Preview for label-studio-playground ready!

Name Link
🔨 Latest commit 4a4ed26
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/68a35810a8ed590008883dfd
😎 Deploy Preview https://deploy-preview-7633--label-studio-playground.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented May 27, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 4a4ed26
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68a3581027162300080260fb

@bmartel
Copy link
Contributor Author

bmartel commented May 28, 2025

/fm sync

Workflow run

@bmartel bmartel changed the title fix: FIT-31: Ensure media buffers are syncable events that keep audio… … and video in sync fix: FIT-31: Ensure media buffers are syncable events that keep audio and video in sync May 29, 2025
@Gondragos
Copy link
Contributor

Gondragos commented Jul 14, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/editor/src/components/TaskSummary/tests/TaskSummary.test.tsx

Gondragos and others added 6 commits July 25, 2025 00:49
# Conflicts:
#	web/libs/editor/src/components/VideoCanvas/VideoCanvas.tsx
#	web/libs/editor/src/tags/object/Video/HtxVideo.jsx
#	web/libs/frontend-test/src/helpers/LSF/VideoView.ts
Co-authored-by: Andrew <[email protected]>
# Conflicts:
#	web/libs/frontend-test/src/helpers/LSF/VideoView.ts
# Conflicts:
#	web/libs/editor/src/tags/object/Paragraphs/HtxParagraphs.jsx
@niklub
Copy link
Collaborator

niklub commented Aug 5, 2025

/git merge

Workflow run
Successfully merged: delete mode 100644 web/libs/app-common/src/blocks/StorageProviderForm/providers/localFiles.ts

@niklub
Copy link
Collaborator

niklub commented Aug 10, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 label_studio/tests/data_import/test_streaming_import.py

@niklub
Copy link
Collaborator

niklub commented Aug 11, 2025

/git merge

Workflow run
Successfully merged: create mode 100644 web/libs/editor/src/lib/AudioUltra/Visual/Renderer/ResizeRenderer.ts

@niklub
Copy link
Collaborator

niklub commented Aug 14, 2025

/git merge

Workflow run
Successfully merged: delete mode 100644 web/libs/editor/src/regions/ImageRegion.js

@Gondragos
Copy link
Contributor

Gondragos commented Aug 18, 2025

/git merge

Workflow run
Successfully merged: 79 files changed, 1663 insertions(+), 347 deletions(-)

@Gondragos
Copy link
Contributor

Gondragos commented Aug 18, 2025

/git merge

Workflow run
Successfully merged: 7 files changed, 159 insertions(+), 20 deletions(-)

@niklub niklub merged commit 0fd582d into develop Aug 21, 2025
63 of 66 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-fit-31 branch August 21, 2025 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants