web-stories-wp
web-stories-wp copied to clipboard
Video Trim: Trimming causes editor to crash
Bug Description
Found during testing of #12349 but recreated in main branch
as well. There is a crash when user tries to trim a video that was recorded in an earlier webcam recording attempt and embedded AS BACKGROUND. Trimming works OK when there is a new video recorded and inserted into the canvas. Trimming also seems to work ok if the previously
Expected Behaviour
Irrespective of when the video was recorded and how it is embedded and what is its source (webcam, external video file, 3rd party video), so long as it can be trimmed, user should be able to trim. There should be no crash.
Steps to Reproduce
- Create a new story
- Record and insert a new video via webcam
- Save draft of the web story
- exit editor, reload editor, and create a new story
- in the new story, locate the video recording from step 2 in the media library
- insert the previousl recorded webcam video as a background video
- click on the video inserted and attempt to trim the video
Issue: Editor crashes
Screenshots
Additional Context
- Plugin Version: main branch as of 9/22/2022
- WordPress Version: WP 6.0.3
- Operating System: Windows 10
- Browser: Chrome
In my first test this was enough:
- Insert video from library
- Try trimming
- See crash
Now even with your steps I cannot reproduce this anymore, very strange.
According to the error message this is where the error occurs:
https://github.com/GoogleForCreators/web-stories-wp/blob/08fb63abf44011d90f84b4deefd0a09062c5f2da/packages/element-library/src/video/trim.js#L115
Though I don't see why tracks
would not be defined, it defaults to an empty array.
When this happens to you again, can you share the story data from our hidden dev tools here?
If the error here was the undefined tracks
, wasn't this solved in this PR?
Yes looks like a duplicate.
Duplicate of #12471