Add looping videos to articles#14843
Conversation
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
|
(AI suggestions sent me down the wrong path) |
|
This appears to be a CORS issue rather than a code issue. When developing locally we test on The white space appears when the poster image fails to upload for some reason? This is an intermittent issue (because: see screen shot above which loaded the poster image fine 2 mins after failing and 2 mins before failing again):
I noticed this comment in the last PR to touch the LoopVideoPlayer file: |
|
Can confirm that the video src/url strings are correct (pasting the url into the browser address bar loads the video) |
|
Viewing the article locally, using http://r.thegulocal.com:3030/Article/https://www.theguardian.com/media/2025/oct/08/conservative-late-night-talkshow URL. doesn't solve the issue: |
|
tl;dr: Looping videos now need to be served with a Chat messages: AnnaB, MarjanK Anna: We introduced (and rolled back) a crossOrigin="anonymous" header to looping videos so that we can retrieve the subtitle vtt file from uploads.guim. This change meant that both the video and the subtitle files are now requested as cross-origin CORS fetches, requiring fastly to include Access-Control-Allow-Origin headers. Unsuprisingly, uploads.guim already has https://www.theguardian.com as an allowed origin but some users were getting the following error Does anyone have any ideas as to why some users would be hitting this error? I'm wondering if some users could be getting a cached mp4 response that does not have the headers attached because we did not ask for them before this change was rolled out and if we therefore need to purge the cache for some videos. Does that sound plausible? Are we able to purge certain items in the uploads.guim cache? The fastly VCL is available here if anyone is interested in looking through it https://manage.fastly.com/configure/services/2TmfkSoyUoNo8aFNe6Htjs/versions/29/vcl/snippets/CORS%20headers Marjan [...etc] |
dotcom-rendering/src/components/LoopVideoInArticle.importable.tsx
Outdated
Show resolved
Hide resolved
19644a1 to
e8451e3
Compare
979a78b to
db38c0d
Compare
| fallbackImageLoading="lazy" | ||
| fallbackImageSize="small" | ||
| height={400} | ||
| linkTo="Article-embed-MediaAtomBlockElement" |
There was a problem hiding this comment.
This needs to be considered. It's used for tracking events eg when video first comes into view. This was developed with Fronts in mind, so I don't know if that tracking is useful for progression through the article? I put it in as a hardcoded text, but maybe a better approach would be to use the article URL here?
dotcom-rendering/src/components/LoopVideoInArticle.importable.tsx
Outdated
Show resolved
Hide resolved
dotcom-rendering/src/components/LoopVideoInArticle.importable.tsx
Outdated
Show resolved
Hide resolved
07cd67d to
3463988
Compare
…ithub.com/guardian/dotcom-rendering into rjr-investigate-looping-video-in-articles
RikRootsGuardian
left a comment
There was a problem hiding this comment.
I would approve if I was permitted to - but only for the code updates made by @simonbyford
Merging remains blocked until someone approves my code changes
|
Seen on PROD (merged by @RikRootsGuardian 7 minutes and 58 seconds ago) Please check your changes! |




What does this change?
Displays looping self-hosted videos (ones with
videoPlayerFormat=Loop) in the appropriate player.Why?
Looping videos currently render correctly on fronts, but not in articles.
How to test
Deploy to CODE. Create an article in CODE Composer and include a self-hosted video atom. When you preview the article, the video should display in the appropriate player, according the "Video Player Format" setting from Media Atom Maker:
If set to "Standard", it should display in the normal player
If set to "Loop", it should display in the looping player
Screenshots
Related PRs