Last active
September 24, 2021 14:10
-
-
Save watershed/2035323f04081b02e1f6aa393e328e81 to your computer and use it in GitHub Desktop.
Vimeo embedding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Historically, Vimeo URLs of the following form would work as a straightforward `src` attribute value on an iframe --> | |
<iframe src="https://player.vimeo.com/video/123456789" width="X" height="Y" allowfullscreen></iframe> | |
<!-- At some point in September 2021 Vimeo changed this, so that URLs require an `h` parameter to work --> | |
<iframe src="https://player.vimeo.com/video/123456789?h=8yt65b2a98" width="X" height="Y" allowfullscreen></iframe> | |
<!-- | |
In the above examples: | |
* `123456789` should be your video ID and `8yt65b2a98` should be its unique key. | |
* The X and Y width and height values should be replaced with | |
whatever numbers work for your context. I like to use width="336" height="189" | |
as a decent mobile friendly baseline of 16:9 proportions. | |
What HTML your iframe is wrapped in should take care of how it ends up getting | |
styled to fit its container. For basic usage, Vimeo’s *full* embed code works, | |
but I like to get rid of all the cruft. | |
--> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The canonical page for the example video above would be:
So this can be coerced into the embed schema with a regular expression (regex) like this:
Regex search pattern:
Regex replacement pattern:
This could, for example, be applied to a regular Vimeo URL in cell A2 in a Google Sheet, to output the embed equivalent in a neighbouring column with:
Any additional URL parameters, such as
autoplay=1
, should be appended (with a preceding&
), so the spreadsheet formula could be adapted to: