Repository navigation
Don't render videos with relative or invalid URLs, show the error in development builds - #5889
Conversation
|
TODO: Can we have snaps for this, so we don't break it? Also, dark-green video could work better in this case. |
|
db0c765 to
873c215
Compare
|
This one is on hold. We're still figuring if we want relative URL support at all. |
|
This one can change direction to the opposite: don't render relative URLs surfacing the broken activity/attachment error in dev mode. |
873c215 to
f9c2ad9
Compare
f9c2ad9 to
965c825
Compare
407218d to
a9fc9f6
Compare
|
a9fc9f6 to
f6bf999
Compare
…development builds
5e3a33c
f6bf999 to
5e3a33c
Compare
William Wong (compulim)
left a comment
There was a problem hiding this comment.
Nitpicking.
| await waitFor(() => expect(absoluteVideoElement.readyState).toBe(HTMLMediaElement.HAVE_ENOUGH_DATA)); | ||
| await waitFor(() => expect(requestedURLs).toContain(absoluteURL)); | ||
|
|
||
| // THEN: The relative URLs should never be requested from the server of this page. |
There was a problem hiding this comment.
It's a bit "far" from where the relativeURLs are.
Later, we should consider split this test into multiple (relative, invalid, YouTube/Vimeo).
There was a problem hiding this comment.
Agreed, we'll split it into relative, invalid and YouTube/Vimeo tests in a follow-up PR after this one merges.
Changelog Entry
Fixed
Description
VideoContentcallednew URL(src)to detect YouTube and Vimeo links, which throws for relative URLs and URLs that cannot be parsed, so the whole attachment disappeared in every build. Thesrcprop now requires an absolute URL: development builds fail prop validation and show the existing error for an attachment that fails to render, and production builds, which do not validate props, leave out the video and show the rest of the card. YouTube and Vimeo URLs without a video ID are no longer embedded and play in<video>, like other URLs that cannot be embedded.Design
//host/..., are never resolved or requested, because they would point to a different server in each chat client.Specific Changes
Attachment/VideoContent.tsx:srcmust be an absolute URL, render nothing if it cannot be parsed, embed YouTube and Vimeo only with a video ID<a href>URL parsing workaround for Internet ExplorerAttachment/VideoContent.spec.tsx: production builds render nothing for relative and invalid URLs__tests__/html2/attachment/video.url.html: development builds show the error for relative and invalid URLs and never request them; YouTube and Vimeo URLs without a video ID play in<video>CHANGELOG.mdReview Checklist
z-index)package.jsonandpackage-lock.jsonreviewed