label-studio
label-studio copied to clipboard
fix: FIT-31: Ensure media buffers are syncable events that keep audio and video in sync
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_BUFFERINGto 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
Timelinecomponent's controls, including new SCSS styles and animations. (web/libs/editor/src/components/Timeline/Controls.scss) [1] [2] - Updated the
VideoCanvascomponent 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
useSyncedBufferinghook to manage synchronized buffering states across components using Jotai atoms. (web/libs/editor/src/hooks/useSyncedBuffering.ts) - Updated the
VideoCanvasandHtml5Playercomponents 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
Playerclass to include abufferingproperty and handle buffering events (canplayandwaiting) with debounced updates. (web/libs/editor/src/lib/AudioUltra/Controls/Player.ts) [1] [2] - Adjusted the
TimelineandVideoCanvascomponents 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.
Deploy Preview for heartex-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 4a4ed265865488c82b9941a282919a1cb09f4ffd |
| Latest deploy log | https://app.netlify.com/projects/heartex-docs/deploys/68a3581079cc9900084e32b8 |
Deploy Preview for label-studio-storybook ready!
| Name | Link |
|---|---|
| Latest commit | 4a4ed265865488c82b9941a282919a1cb09f4ffd |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for label-studio-playground ready!
| Name | Link |
|---|---|
| Latest commit | 4a4ed265865488c82b9941a282919a1cb09f4ffd |
| 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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Deploy Preview for label-studio-docs-new-theme canceled.
| Name | Link |
|---|---|
| Latest commit | 4a4ed265865488c82b9941a282919a1cb09f4ffd |
| Latest deploy log | https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/68a3581027162300080260fb |
Codecov Report
:x: Patch coverage is 90.00000% with 53 lines in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 66.61%. Comparing base (2ba7706) to head (4a4ed26).
:warning: Report is 20 commits behind head on develop.
Additional details and impacted files
@@ Coverage Diff @@
## develop #7633 +/- ##
===========================================
- Coverage 70.43% 66.61% -3.83%
===========================================
Files 721 509 -212
Lines 52231 34576 -17655
Branches 8837 8990 +153
===========================================
- Hits 36789 23032 -13757
+ Misses 15439 11541 -3898
Partials 3 3
| Flag | Coverage Δ | |
|---|---|---|
| lsf-e2e | 60.03% <64.83%> (+0.32%) |
:arrow_up: |
| lsf-integration | 55.98% <83.93%> (+0.44%) |
:arrow_up: |
| lsf-unit | 9.41% <5.78%> (-0.02%) |
:arrow_down: |
| pytests | ? |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
/git merge
Workflow run Successfully merged: create mode 100644 web/libs/editor/src/components/TaskSummary/tests/TaskSummary.test.tsx
/git merge
Workflow run Successfully merged: delete mode 100644 web/libs/app-common/src/blocks/StorageProviderForm/providers/localFiles.ts
/git merge
Workflow run Successfully merged: create mode 100644 label_studio/tests/data_import/test_streaming_import.py
/git merge
Workflow run Successfully merged: create mode 100644 web/libs/editor/src/lib/AudioUltra/Visual/Renderer/ResizeRenderer.ts
/git merge
Workflow run Successfully merged: delete mode 100644 web/libs/editor/src/regions/ImageRegion.js