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.

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

Great idea. Possible to do the same with soundcloud / bandcamp?

#3 November 24, 2018, 05:43:58 PM Last Edit: November 24, 2018, 05:58:36 PM by Hambeast
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

Nice one, appreciate the hard slough.

Top work, thanks. I'd second the Bandcamp idea, that would be very cool.

Thank you Hambeast for all you work on the site. That's great  :abbath:
Deep Down Six Feet, Is Where I Like To Eat

Is there any way of getting the mobile youtube embeds going?

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.

Mobile embeds should now be working. Let me know of any issues, with size in particular.

I hadn't seen this and threw one up the other day expecting it not to work so fair play tis grand now seemingly

Wouldn't work for me yesterday. Tried a few different ways but the embedded video wouldn't work for any of them.

#12 April 05, 2024, 11:48:59 AM Last Edit: April 05, 2024, 11:50:32 AM by Hambeast
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.

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

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.