Metal Warfare - Irish Metal Forum

Metal Discussion => Metal Warfare site-related => Topic started by: Hambeast on November 23, 2018, 10:03:21 PM

Title: YouTube Embeds
Post by: Hambeast on November 23, 2018, 10:03:21 PM
I've added a feature so YouTube videos now automatically display in the forum when they're linked. It's set to only run on a computer. I figure it'd be annoying on mobile.

If there's any issues or you hate it, let me know and it can be disabled.
Title: Re: YouTube Embeds
Post by: astfgyl on November 23, 2018, 11:38:46 PM
I think it is a brilliant idea but I'm on a laptop. I checked out 4 things i've never heard already because of it
Title: Re: YouTube Embeds
Post by: The Butcher on November 24, 2018, 12:57:46 AM
Great idea. Possible to do the same with soundcloud / bandcamp?
Title: Re: YouTube Embeds
Post by: Hambeast on November 24, 2018, 05:43:58 PM
Soundcloud works but it's more difficut

You need to grab the Embed code from the "Share" link and copy part of it, then change "%3A" to a colon

<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/88186893&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>

Results in:
https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/88186893

Which gives this when posted:
https://w.soundcloud.com/player/?url=https://api.soundcloud.com/tracks/88186893

Not very simple. Plus it probably makes things difficult for people on mobile.

I'll see if I can get in touch with the plugin developer to fix it and get BandCamp working too
Title: Re: YouTube Embeds
Post by: The Butcher on November 25, 2018, 12:14:36 AM
Nice one, appreciate the hard slough.
Title: Re: YouTube Embeds
Post by: Juggz on November 26, 2018, 11:11:50 AM
Top work, thanks. I'd second the Bandcamp idea, that would be very cool.
Title: Re: YouTube Embeds
Post by: livingabortion on December 13, 2022, 02:56:02 AM
Thank you Hambeast for all you work on the site. That's great  :abbath:
Title: Re: YouTube Embeds
Post by: astfgyl on March 10, 2024, 06:18:58 PM
Is there any way of getting the mobile youtube embeds going?
Title: Re: YouTube Embeds
Post by: Hambeast on March 13, 2024, 10:00:17 AM
Something seems to have broke with the plugin which handles embedding. I'll need to find some time to dig into it and see what's happened.
Title: Re: YouTube Embeds
Post by: Hambeast on April 01, 2024, 06:06:15 PM
Mobile embeds should now be working. Let me know of any issues, with size in particular.
Title: Re: YouTube Embeds
Post by: astfgyl on April 04, 2024, 05:22:15 PM
I hadn't seen this and threw one up the other day expecting it not to work so fair play tis grand now seemingly
Title: Re: YouTube Embeds
Post by: Carnage on April 04, 2024, 05:48:40 PM
Wouldn't work for me yesterday. Tried a few different ways but the embedded video wouldn't work for any of them.
Title: Re: YouTube Embeds
Post by: Hambeast on April 05, 2024, 11:48:59 AM
Do you mean the occasional "Video unavailable" error, or it's not embedding at all?

You don't need to use the [youtube] tags to embed. You can just paste a link and the forum will automatically convert it to an embed when you submit the post. There's a limitation in the embed code where it doesn't process the link correctly if it ends with "?si=oSyo0IEAaCXsASCn" which happens if you grab the link via the "share" button on youtube. The "si" part of the link is some tracking thing which isn't actually needed. The workaround is to delete this part of the link before you post it.

eg:
Copied link:
https://youtu.be/zYMqbcQQUvI?si=oSyo0IEAaCXsASCn

Delete the ?si= part so your link looks like:
https://youtu.be/zYMqbcQQUvI

Post any links here which aren't working and I'll look into it to see what's going on.
Title: Re: YouTube Embeds
Post by: Carnage on April 05, 2024, 12:37:45 PM
Yeah, I just posted a link and got the 'video unavailable' text. Tried it with the tags, same thing. I'll cut out that bit and try again.

This was the post where it didn't work:

https://forum.metalwarfare.com/index.php?topic=2472.msg95597#msg95597
Title: Re: YouTube Embeds
Post by: Hambeast on April 05, 2024, 03:36:26 PM
Looks like youtube doesn't play nice with one of the referrer-policy headers I had set. I've changed it and it looks to be working now. Hopefully it'll also fix the issue with any other videos too.
Title: Re: YouTube Embeds
Post by: Carnage on April 05, 2024, 04:16:11 PM
Sound, nice one.
Title: Re: YouTube Embeds
Post by: Carnage on June 25, 2024, 08:25:44 PM
I'm seeing a lot of overlapping of posts where there are Youtube embeds. The Riffs thread, for instance.

Screenshot_20240625-202250_Chrome.jpg

Chrome on an Android phone.
Title: Re: YouTube Embeds
Post by: Hambeast on June 26, 2024, 11:22:33 AM
Fixed! Thanks for the report.
Title: Re: YouTube Embeds
Post by: Carnage on June 26, 2024, 11:29:21 AM
Nice one, cheers. 👍