web-stories-wp icon indicating copy to clipboard operation
web-stories-wp copied to clipboard

Video Trim: Trimming causes editor to crash

Open kkalarickal opened this issue 2 years ago • 1 comments

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

  1. Create a new story
  2. Record and insert a new video via webcam
  3. Save draft of the web story
  4. exit editor, reload editor, and create a new story
  5. in the new story, locate the video recording from step 2 in the media library
  6. insert the previousl recorded webcam video as a background video
  7. click on the video inserted and attempt to trim the video

Issue: Editor crashes

Screenshots

image.png

Additional Context

  • Plugin Version: main branch as of 9/22/2022
  • WordPress Version: WP 6.0.3
  • Operating System: Windows 10
  • Browser: Chrome

kkalarickal avatar Sep 22 '22 20:09 kkalarickal

In my first test this was enough:

  1. Insert video from library
  2. Try trimming
  3. 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?

swissspidy avatar Sep 23 '22 07:09 swissspidy

If the error here was the undefined tracks, wasn't this solved in this PR?

barklund avatar Dec 19 '22 19:12 barklund

Yes looks like a duplicate.

Duplicate of #12471

swissspidy avatar Dec 19 '22 20:12 swissspidy