Repository navigation
fix: shift video positions to the start of video clips - #179
Closed
saraburns1 wants to merge 2 commits into
Closed
saraburns1 wants to merge 2 commits into
saraburns1 wants to merge 2 commits into
Conversation
Video blocks can be configured to play only a clip of the source video. The player reports positions against the full source video but the duration of only the clip, so positions could be past the end of the video. Shift positions by the clip start time from the course block data, when the reported duration matches the clip. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Oct 8, 2026
Closed
Completed events report the video duration as the position, which is already relative to the clip. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Video blocks can be set to play only a clip of the source video (start/end time in Studio). The player reports
timeagainst the full source video butlengthas the clip duration, so video positions in dashboards can be past the end of the video (e.g. 4:00 in a 3-minute video), and watched segments / completion are off.Depends on openedx/platform-plugin-aspects#259, which adds
video_start_time/video_end_timetoxblock_data_json.Changes:
dim_most_recent_course_blocksand thedim_course_block_namesdictionary carryvideo_start_timeandvideo_end_time.video_playback_eventslooks up the block indim_course_block_namesand subtracts the clip start from the position (clamped at 0), before the existing rounding up. It only shifts when the event'slengthmatches the clip (within 1s), so events from players that play the full video are left alone. Unclipped videos and blocks not yet in ClickHouse are unchanged.video_playback_events/fact_video_segments, so they all pick up the fix.Upgrade notes
dim_most_recent_course_blocksgets new columns, so it needs a full refresh (dbt run --full-refresh -s dim_most_recent_course_blocks). A normal run only updates the view's query. The table is small.video_playback_eventsare only corrected by a full refresh ofvideo_playback_events+, which reprocesses all xAPI events. That's optional and can be expensive on large instances.Testing
test_video_playback_events_clipped_videoscovers clipped, before-clip-start, full-player, unclipped and start-only cases. It fails against the old model.dim_most_recent_course_blocksanddim_course_block_nameshave the new columns (all 0, as the generated test data has no clipped videos).fact_video_segmentsin 1–180 instead of up to 240.sqlfmt --checkand doc coverage pass.🤖 Generated with Claude Code