YouTube Autoembeds for Live Streams

I run a few live events using Streamyard that go directly to YouTube. The stream becomes the recording, so the link is always good.

I notice that Discourse does not seem to embed the different URL format YouTube uses for this videos giving a generic OneBox e.g.,

https://www.youtube.com/live/eJemwqO0SDw e.g.

whereas by manually using the same ID in a standard YouTube URL does work in Discourse

https://www.youtube.com/watch?v=eJemwqO0SDw renders as expected

YouTube does not readily provide this form of a live stream video as a share link, so I end up manually re-writing the URLs. Seems like some pattern matching magic could manage this?

3 Likes

Anyone got a reply? This sure seems like a (like I would know) a search and replace for youtube links.

This happened again today:

This link fails to embed
https://www.youtube.com/live/N4vz0rlpXus?feature=shared&t=1355

But this does
https://www.youtube.com/watch?v=N4vz0rlpXus&t=1355

Yes, I can figure this out manually but the average user?

Anyone there?

2 Likes

This needs a change in the YouTube onebox code to accept both URLs interchangeably. Very similar to what I did in Twitch clips embed problem.

Tagging this as pr-welcome for now.

2 Likes

I made a PR:

7 Likes

Let’s try again https://www.youtube.com/live/eJemwqO0SDw:

https://www.youtube.com/live/N4vz0rlpXus?feature=shared&t=1355:


Looks good!

5 Likes