Conversation
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.
Drop Zone Ops — Auto Duration Detection + Bug Fixes
Summary
Three focused improvements following the v2 merge: automatic video duration detection on file drop, a critical memory crash fix, and a UI count bug fix.
Changes
⏱ Auto Duration Detection
When you drop local video files into the Drop Zone, the app now automatically reads each file's duration and pre-fills it in the playlist — no manual entry required.
How it works:
<video>element loads just the metadata (not the full video)onloadedmetadatafires, duration is captured in secondsURL.revokeObjectURL()is called immediately — file is released from memoryMM:SSformatScope:
0gracefully — no crash, no missing item🐛 Critical Fix — Memory Crash on Large File Drops
The initial duration detection implementation caused a browser crash when dropping multiple files (reproduced with 198 files).
Root cause — two issues:
onloadedmetadataandonerrorhandlers were not nulled after firing, allowing the browser to re-trigger them repeatedly on the same video elementforEach— every file created its own object URL and video element at the same time, holding everything in memory in parallel until the browser ran out of resourcesFix:
video.onloadedmetadata = null,video.onerror = null) before any other operationsvideo.src = ''andURL.revokeObjectURL()called in the same cleanup pass🐛 Fix — Header Item Count Shows "1 ITEM" on Empty Playlist
After clearing the playlist or deleting all items, the header status pill incorrectly showed
1 ITEMinstead of0 ITEMS.Root cause: The
render()function has an early return when the playlist is empty.updateStats()andupdatePreview()were both called before that early return, butupdatePill()was only called later in the function — after the early return had already exited, so the header count never updated.Fix: Added
updatePill()to the empty state early return block alongside the existingupdateStats()andupdatePreview()calls.Files Changed
index.htmlTesting
0 ITEMS✅0 ITEMS✅0duration, item added normally ✅