Web-stories-wp: Missing poster on inserting NEW video from Media Library

Created on 14 Dec 2020  路  4Comments  路  Source: google/web-stories-wp

Bug Description

If we upload a video, close the upload modal and insert the new video from. the Media Library, the video poster will not be able to show up.

Expected Behaviour

The video poster should be able to show up as expected.

Steps to Reproduce

  1. Upload a video, then close the uploader modal.
  2. Click on blue "Upload" button > "Media Library" tab in popup > select a video > "Insert into page"

Screenshots

Screen Shot 2020-12-14 at 12 16 30 PM

_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance Criteria

Implementation Brief

Accessibility Video Design Panel P2 Bug

Most helpful comment

So what's happening is basically this:

  1. Click on "Upload" button to open media modal
  2. Upload video
  3. Close modal _without_ inserting the video
  4. The media library refreshes because there now is a new video
  5. The processor looper in useContextValueProvider.js sees the new video and generates & uploads a poster
    _(so far so good)_
  6. Click on "Upload" button to open media modal
    At this point, the media modal will have partially stale data, because opening the modal does not currently reload media from the server.
    This is a known issue with the WP media modal that haven't found a workaround for so far.
  7. Select previously uploaded video and insert it into page
  8. Because of the stale data, there's no poster information attacched to the selected video (which getResourceFromMediaPicker() looks for), so the logic in useContextValueProvider.js tries to generate a poster again, but skips early because the video is already in the "processed" list.

All 4 comments

Dang, yet another video poster bug 馃槥

Any findings so far?

Once poster "reset" is fixed, this can probably be P3.

So what's happening is basically this:

  1. Click on "Upload" button to open media modal
  2. Upload video
  3. Close modal _without_ inserting the video
  4. The media library refreshes because there now is a new video
  5. The processor looper in useContextValueProvider.js sees the new video and generates & uploads a poster
    _(so far so good)_
  6. Click on "Upload" button to open media modal
    At this point, the media modal will have partially stale data, because opening the modal does not currently reload media from the server.
    This is a known issue with the WP media modal that haven't found a workaround for so far.
  7. Select previously uploaded video and insert it into page
  8. Because of the stale data, there's no poster information attacched to the selected video (which getResourceFromMediaPicker() looks for), so the logic in useContextValueProvider.js tries to generate a poster again, but skips early because the video is already in the "processed" list.

Nice investigation.

Once poster "reset" is fixed, this can probably be P3.

Nevermind, "reset" doesn't actually force-regenerate the poster.

@zidianlyu As discussed: to catch other possible causes for "missing poster", let's add a check on video insertion into the page that the poster is not undefined and log it (e.g. throwing a JS error should be surfaced in GA).

Was this page helpful?
0 / 5 - 0 ratings