Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for Vimeo vids in VideoEmbed #11412

Merged
merged 4 commits into from
Nov 19, 2024
Merged

Allow for Vimeo vids in VideoEmbed #11412

merged 4 commits into from
Nov 19, 2024

Conversation

rcantin-w
Copy link
Contributor

What does this change?

#11408

Our slices allowed for Youtube and Vimeo in that it would still treat it in the Body transformer, but once you got to VideoPlayer, it was strictly Youtube. This is probably due to the fact that we haven't had a Vimeo video in the time I've been here (So around 2 and a half years at a minimum).

With the problems we're currently experiencing with YT, we'd like to go back to supporting Vimeo.

So this ticket:

  • Makes VideoEmbed/VideoPlayer more flexible; now passing in videoProvider (for easier conditionals) & videoThumbnail (for the Vimeo Thumbnail)
  • Adds those fields to the Highlight Tours transformer: hcontent/webapp/services/prismic/transformers/exhibition-highlight-tours.ts
  • Adds those fields to content/webapp/services/prismic/transformers/exhibition-guides.ts as well, which supports legacy EG.

There are a few TODOs in the code now, they're up for conversation with whoever reviews this/might be done as a later task (if so I will tidy and create new tickets), to prioritise just rendering those videos.

How to test

Run locally with Prismic staging API

How can we measure success?

Renders YT and Vimeo successfully

Have we considered potential risks?

If doubled QA'd, should be low risk

Copy link

github-actions bot commented Nov 18, 2024

Size Change: -10.5 kB (-1.04%)

Total Size: 996 kB

Filename Size Change
content/webapp/.next/static/chunks/3514.b981f295d2d50129.js 0 B -4.25 kB (removed) 🏆
content/webapp/.next/static/chunks/4137-e8e9ad55565f29c7.js 0 B -4.18 kB (removed) 🏆
content/webapp/.next/static/chunks/4176.a5a9d38930a9a72c.js 0 B -2.38 kB (removed) 🏆
content/webapp/.next/static/chunks/5563.b1d6c25f8e09c24b.js 0 B -5.78 kB (removed) 🏆
content/webapp/.next/static/chunks/6153-bbc31723b820655d.js 0 B -4.42 kB (removed) 🏆
content/webapp/.next/static/chunks/6157-37c2cf882ac57f14.js 0 B -6.08 kB (removed) 🏆
content/webapp/.next/static/chunks/9508-544994fa98215455.js 0 B -3.44 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/[uid]-090b77251ccce9c7.js 0 B -1.95 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/about-us-5a0a4ff91b2716d5.js 0 B -1.95 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/about-us/[uid]-aa731a8bd85529c5.js 0 B -1.95 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/about-us/cookie-policy-8682d538b6d0e620.js 0 B -5.99 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/books/[bookId]-03c5e8482cb0fd4c.js 0 B -4.09 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/collections-a405936f8df649d8.js 0 B -2.36 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/collections/[uid]-665266d50e95e16a.js 0 B -1.95 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/event-series/[eventSeriesId]-7980162f94d7ebaa.js 0 B -2.93 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/events/[eventId]-5493c4ddceca36bc.js 0 B -8.88 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]-7b656ebf55430ae0.js 0 B -3.98 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/get-involved-90dcdaebf2106057.js 0 B -1.95 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/get-involved/[uid]-30be65ca154c0f55.js 0 B -1.96 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/guides/[guideId]-ae393b25e6ea5b0c.js 0 B -2.26 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]-a5d81bcba8a80e13.js 0 B -9.57 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]/[stop]-9dcabeefe9ec5add.js 0 B -5.97 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/pages/[pageId]-2e686fba764447a6.js 0 B -1.92 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/projects/[projectId]-e44acf1499d67bd0.js 0 B -2.24 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/seasons/[seasonId]-6b54ec76d9601a7f.js 0 B -3.86 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/series/[seriesId]-32a35292b60cd4a0.js 0 B -5.09 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/slice-simulator-f51a5414d80af3c6.js 0 B -967 B (removed) 🏆
content/webapp/.next/static/chunks/pages/stories/[articleId]-4747e1981ab77cdb.js 0 B -9.43 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/visit-us-d1eb7545d747d29c.js 0 B -2.28 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/visit-us/[uid]-9533b8552b1690c0.js 0 B -1.96 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/works/[workId]-ea8d59ffe91fbc51.js 0 B -22.7 kB (removed) 🏆
content/webapp/.next/static/chunks/pages/works/[workId]/items-84bedb71ce4c37ce.js 0 B -4.85 kB (removed) 🏆
content/webapp/.next/static/chunks/webpack-05c6af4cf91a5a7c.js 0 B -2.31 kB (removed) 🏆
content/webapp/.next/static/chunks/2815-7fe70ae65244df23.js 3.59 kB +3.59 kB (new file) 🆕
content/webapp/.next/static/chunks/3514.f980bc5a980d71d8.js 4.39 kB +4.39 kB (new file) 🆕
content/webapp/.next/static/chunks/4137-5e52495ab949e477.js 3.67 kB +3.67 kB (new file) 🆕
content/webapp/.next/static/chunks/4812-f0eac5a32b85c27e.js 3 kB +3 kB (new file) 🆕
content/webapp/.next/static/chunks/5563.01ba248b955b9dde.js 2.98 kB +2.98 kB (new file) 🆕
content/webapp/.next/static/chunks/6153-e58a73aa21d9ec87.js 4.43 kB +4.43 kB (new file) 🆕
content/webapp/.next/static/chunks/9508-9b73310484baff33.js 3.48 kB +3.48 kB (new file) 🆕
content/webapp/.next/static/chunks/9743.f8af0ac37a915518.js 3.08 kB +3.08 kB (new file) 🆕
content/webapp/.next/static/chunks/9781-b4c88e0155f5e852.js 3.49 kB +3.49 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/[uid]-84e9b9b2b5b0311d.js 1.95 kB +1.95 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/about-us-37d86f320b30736a.js 1.95 kB +1.95 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/about-us/[uid]-934c8ed775ac39d3.js 1.96 kB +1.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/about-us/cookie-policy-06499ba697bf5476.js 6 kB +6 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/books/[bookId]-c4933ce87af043bd.js 4.1 kB +4.1 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/collections-1510a07bf52ff2ea.js 2.36 kB +2.36 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/collections/[uid]-c4ee35382d8f0a84.js 1.96 kB +1.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/event-series/[eventSeriesId]-2d7c32d5e921a700.js 2.93 kB +2.93 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/events/[eventId]-175b04d7a942f634.js 8.88 kB +8.88 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]-37eeffc6046a7c89.js 3.98 kB +3.98 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/get-involved-fc5ced56b05711db.js 1.96 kB +1.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/get-involved/[uid]-62a0898a686f4df8.js 1.96 kB +1.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/guides/[guideId]-cc01e4afb44d9fca.js 2.27 kB +2.27 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]-386f7dc21c292f96.js 7.21 kB +7.21 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]/[type]/[stop]-eaaeacc0c79312f2.js 3.71 kB +3.71 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/pages/[pageId]-84e6cc95a26ffe0b.js 1.92 kB +1.92 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/projects/[projectId]-7ef9047adb96e986.js 2.24 kB +2.24 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/seasons/[seasonId]-d7e31481acf43a32.js 3.87 kB +3.87 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/series/[seriesId]-4850856f4ac8e98a.js 5.09 kB +5.09 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/slice-simulator-6e888720b35236c3.js 976 B +976 B (new file) 🆕
content/webapp/.next/static/chunks/pages/stories/[articleId]-da57b6160370b327.js 6.63 kB +6.63 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/visit-us-a454c2c25bf61028.js 2.28 kB +2.28 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/visit-us/[uid]-563091e13ed8f816.js 1.96 kB +1.96 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/works/[workId]-7b2b344b7a267313.js 20.5 kB +20.5 kB (new file) 🆕
content/webapp/.next/static/chunks/pages/works/[workId]/items-0758a2dc89e1beb7.js 2.35 kB +2.35 kB (new file) 🆕
content/webapp/.next/static/chunks/webpack-5ec6b0fc6556ac09.js 2.33 kB +2.33 kB (new file) 🆕
ℹ️ View Unchanged
Filename Size
content/webapp/.next/static/chunks/00a8a139.e66d72e5d4e63786.js 58.7 kB
content/webapp/.next/static/chunks/1042.5e93690fb7f8387e.js 264 B
content/webapp/.next/static/chunks/1091.16812ffd5b0a4e6b.js 356 B
content/webapp/.next/static/chunks/1315.1023b846a2b11b1d.js 4.59 kB
content/webapp/.next/static/chunks/1895-507f9544a4d6b6f5.js 2.28 kB
content/webapp/.next/static/chunks/1922.9dfdf98cc215e6dc.js 3.69 kB
content/webapp/.next/static/chunks/2075-d891038ae834fd5b.js 6.98 kB
content/webapp/.next/static/chunks/2158.8f30889d7a1b3169.js 3.24 kB
content/webapp/.next/static/chunks/23-cf5a7458cbf01e28.js 2.67 kB
content/webapp/.next/static/chunks/2614-b089e3e692ce42a9.js 7.17 kB
content/webapp/.next/static/chunks/286.e6c4fb42dbebd142.js 20.7 kB
content/webapp/.next/static/chunks/3279.dcaa1a87d27aea6a.js 2.64 kB
content/webapp/.next/static/chunks/3310.3608c7a584df8db5.js 2.43 kB
content/webapp/.next/static/chunks/3407.8b6dc286e5611abd.js 264 B
content/webapp/.next/static/chunks/3562.1a682406fccbb2ec.js 371 B
content/webapp/.next/static/chunks/3661-448bee7d2db2b975.js 3.41 kB
content/webapp/.next/static/chunks/3761.5a8f62ff6e7a1f25.js 6 kB
content/webapp/.next/static/chunks/4125.067d1eec1c3eb4af.js 2.19 kB
content/webapp/.next/static/chunks/4462-1870aa794a166104.js 3.06 kB
content/webapp/.next/static/chunks/4494-9ee08e6cd2d95cc0.js 4.68 kB
content/webapp/.next/static/chunks/4621-a46d5953a009fcb0.js 4.57 kB
content/webapp/.next/static/chunks/4704-7fa9ebb41eea98d6.js 4.34 kB
content/webapp/.next/static/chunks/5041.a2ec4f918c672fc2.js 277 B
content/webapp/.next/static/chunks/5164-f4e3d82c5bdb0c7a.js 7.11 kB
content/webapp/.next/static/chunks/5226.27a8b37a28a5e8cc.js 3.37 kB
content/webapp/.next/static/chunks/5239-d3cc68cce4a94ba9.js 3.2 kB
content/webapp/.next/static/chunks/5261.1ef06491100d92a2.js 4.57 kB
content/webapp/.next/static/chunks/5314-80c2775b2f5dc394.js 4.77 kB
content/webapp/.next/static/chunks/5939-d1a715b0e5867fe7.js 2.92 kB
content/webapp/.next/static/chunks/5946-287e65639e4289fa.js 3.7 kB
content/webapp/.next/static/chunks/6170.c0198db8364d899d.js 2.48 kB
content/webapp/.next/static/chunks/628-a14babf3fb2eb9d3.js 4.78 kB
content/webapp/.next/static/chunks/6287.ee607762046728e7.js 1.57 kB
content/webapp/.next/static/chunks/632-d69f29b17e01a4e4.js 3.13 kB
content/webapp/.next/static/chunks/6425-463de300c9e3974e.js 6.66 kB
content/webapp/.next/static/chunks/6577-545b35fa00e662d2.js 3.9 kB
content/webapp/.next/static/chunks/7107-7a0c6bd1411921e2.js 33.8 kB
content/webapp/.next/static/chunks/721-8422ecc6bd9759ae.js 7.55 kB
content/webapp/.next/static/chunks/7267-d9ca9d41f5d22bfd.js 4.45 kB
content/webapp/.next/static/chunks/7339.374c3283d903835f.js 1.64 kB
content/webapp/.next/static/chunks/7425.f863991841c87643.js 2.45 kB
content/webapp/.next/static/chunks/7849.1818ba955cf06736.js 5.04 kB
content/webapp/.next/static/chunks/8091.bd589b180f79feed.js 2.89 kB
content/webapp/.next/static/chunks/8168-71b89264865ea44c.js 16.2 kB
content/webapp/.next/static/chunks/8194-9fe6d45e2c5b9530.js 2.96 kB
content/webapp/.next/static/chunks/8551-bb8b09e56dd31b24.js 5.27 kB
content/webapp/.next/static/chunks/8630.408947dd96fce642.js 1.67 kB
content/webapp/.next/static/chunks/8952.4c2cec41ca6d0c57.js 2.6 kB
content/webapp/.next/static/chunks/8997-afbf62110474f301.js 11.4 kB
content/webapp/.next/static/chunks/framework-978a6051e6d0c57a.js 44.9 kB
content/webapp/.next/static/chunks/main-16881ae36fd18535.js 36.8 kB
content/webapp/.next/static/chunks/pages/_app-5dbf921b094f7518.js 108 kB
content/webapp/.next/static/chunks/pages/_error-1e8090a460deeefd.js 331 B
content/webapp/.next/static/chunks/pages/404-8b7e615af6ded119.js 259 B
content/webapp/.next/static/chunks/pages/500-4bf99f3036ceb64d.js 258 B
content/webapp/.next/static/chunks/pages/books-775381283e1df1f1.js 2.02 kB
content/webapp/.next/static/chunks/pages/concepts/[conceptId]-ff31c55f5003683f.js 3.66 kB
content/webapp/.next/static/chunks/pages/events-8ef663547105417d.js 2.14 kB
content/webapp/.next/static/chunks/pages/events/[eventId]/visual-stories-ec597ffa5627bbc4.js 302 B
content/webapp/.next/static/chunks/pages/exhibitions-42f40ddbef505fd7.js 2.39 kB
content/webapp/.next/static/chunks/pages/exhibitions/[exhibitionId]/visual-stories-2f20155e09ac240f.js 303 B
content/webapp/.next/static/chunks/pages/guides/exhibitions-14628bd8dae14651.js 2.65 kB
content/webapp/.next/static/chunks/pages/guides/exhibitions/[id]-0eaf6c38d3c03ff8.js 2.77 kB
content/webapp/.next/static/chunks/pages/index-8444c22242631cab.js 3.45 kB
content/webapp/.next/static/chunks/pages/newsletter-8d1c5a82c17792a6.js 2.34 kB
content/webapp/.next/static/chunks/pages/search-2102c2928dd0788a.js 5.11 kB
content/webapp/.next/static/chunks/pages/search/events-8c5ae29c842eca33.js 2.03 kB
content/webapp/.next/static/chunks/pages/search/images-e4f5e6305482bee9.js 1.58 kB
content/webapp/.next/static/chunks/pages/search/stories-5708c5228a094a88.js 3.1 kB
content/webapp/.next/static/chunks/pages/search/works-7d082ff992b13625.js 2.94 kB
content/webapp/.next/static/chunks/pages/stories-5c911716939bda1c.js 1.72 kB
content/webapp/.next/static/chunks/pages/visual-stories/[visualStoryId]-6a1c6d49f9a2a817.js 236 B
content/webapp/.next/static/chunks/pages/whats-on-c9310d4e512cbd3f.js 212 B
content/webapp/.next/static/chunks/pages/whats-on/[period]-d0058c8db76a5793.js 283 B
content/webapp/.next/static/chunks/pages/works/[workId]/download-d7d0f47c9c009d0c.js 2.74 kB
content/webapp/.next/static/chunks/pages/works/[workId]/images-dcd5e2de51ef7303.js 697 B
content/webapp/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js 31.1 kB
identity/webapp/.next/static/chunks/286.30e19e68d137a7fe.js 20.7 kB
identity/webapp/.next/static/chunks/442-16a4fdfe63454534.js 9.09 kB
identity/webapp/.next/static/chunks/50.5b4e17f82c3c9a70.js 940 B
identity/webapp/.next/static/chunks/528.b0c7a0dca90cafcc.js 2.71 kB
identity/webapp/.next/static/chunks/644-f0cfb6459ad9993f.js 16.2 kB
identity/webapp/.next/static/chunks/framework-e82a91356956e6c8.js 44.8 kB
identity/webapp/.next/static/chunks/main-9fde6a01d715973d.js 38.9 kB
identity/webapp/.next/static/chunks/pages/_app-8080e12923ac509e.js 105 kB
identity/webapp/.next/static/chunks/pages/_error-f92497dca926c5b1.js 1.45 kB
identity/webapp/.next/static/chunks/pages/delete-requested-aba6285540faf31a.js 3.23 kB
identity/webapp/.next/static/chunks/pages/error-5c81263d2bc0f671.js 1.7 kB
identity/webapp/.next/static/chunks/pages/index-e4ea043acc34600a.js 12 kB
identity/webapp/.next/static/chunks/pages/registration-826df2289f963cc4.js 4.13 kB
identity/webapp/.next/static/chunks/pages/success-bd9f4e9b2f8aef7a.js 3.3 kB
identity/webapp/.next/static/chunks/pages/validated-9d66f88ab86c3ab6.js 3.38 kB
identity/webapp/.next/static/chunks/polyfills-78c92fac7aa8fdd8.js 31.1 kB
identity/webapp/.next/static/chunks/webpack-dd4d49330c88bc7f.js 1.81 kB

compressed-size-action

@@ -10,6 +10,8 @@ import PrismicHtmlBlock from '@weco/common/views/components/PrismicHtmlBlock/Pri

export type Props = {
embedUrl: string;
videoProvider?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you constrain this type further?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

hasFullSizePoster ? 'maxresdefault' : 'hqdefault'
}.jpg`
: isVimeo
? videoThumbnail
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did! But I wasn't sure we wanted to use some third party for this..? There's also this that could be worth a look https://github.com/vimeo/vimeo-oembed-examples ..

Copy link
Contributor

@davidpmccormick davidpmccormick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. My only question is around whether we can auto-fill the thumbnail image, but don't think it's a big deal

@rcantin-w rcantin-w marked this pull request as ready for review November 19, 2024 12:41
@rcantin-w rcantin-w requested a review from a team as a code owner November 19, 2024 12:41
@rcantin-w rcantin-w merged commit fda8fa3 into main Nov 19, 2024
8 checks passed
@rcantin-w rcantin-w deleted the vimeo-embed branch November 19, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants