Skip to content

Instantly share code, notes, and snippets.

@gnat
Last active June 16, 2022 09:39
Show Gist options
  • Save gnat/d378bad6854b0bfe80ac111e0949b62c to your computer and use it in GitHub Desktop.
Save gnat/d378bad6854b0bfe80ac111e0949b62c to your computer and use it in GitHub Desktop.
Odysee does not have trivial embeds yet

You can generate YouTube embed codes by just re-using the ID found in the browser bar. Typical users know only the link they see in the browser bar.

We need a way to get an embed link without scraping please! Youtube and Vimeo both allow it.

This is a note for the devs at Odysee. Hello :)

Vimeo

The URL from the browser window itself: https://vimeo.com/35477260 With 35477260 we can trivially generate the embedded code:

<iframe src="//player.vimeo.com/video/35477260" width="800" height="450"></iframe>

YouTube

The URL from the browser window itself: https://www.youtube.com/watch?v=8Fn_30AD7Pk With 8Fn_30AD7Pk we can trivially generate the embedded code:

<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/8Fn_30AD7Pk" width="800" height="450" 
frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment