NFSAddons Forums

Mar 28, 2024, 1:39 PM

Embedding videos from YouTube

This is a discussion for the topic Embedding videos from YouTube on the board Site Suggestions/Feedback.

Author Topic: Embedding videos from YouTube  (Read 13031 times)

9 Replies on Embedding videos from YouTube
on: Feb 25, 2016, 4:47 AM
Hero Member
Posts: 368 Joined: October 20, 2007

  • *****
Hey guys,

i wondered why its not possible to embed youtube videos in the forums (or is there a way i dont know of?).
I understand HTML code is disabled for security reasons, but there are always ways to make stuff, like embedded videos, work via BBcode.
Since the embed-code is always the same, you could realize some "youtube" button, where users only have to enter the unique video code (which can be found in youtube-links after "..watch?v=") ...for example:

[youtube]video-code[/youtube]

Thats really something i already missed here, when it would have been much easier showing something instead of long explainings.
Embedded videos do not automatically start playing - so its not really a bandwith problem either; especially by today's standards.  ;)

Greetings

Reply #1
on: Feb 28, 2016, 8:23 AM
Administrator Hero Member
Posts: 504 Joined: November 03, 2005

  • *****
Actually, there is a way to embed Youtube videos into forum posts here, I found this out myself only a few years ago and posted it in the screenshots thread, but I suppose I could have posted it in a location where it's more visible:
http://www.nfsaddons.com/forums//index.php?topic=311.msg32063#msg32063

What you do is, you click the 'share' link on a YT video, then go to the 'embed' tag, copy the link and put it between [ html]  tags like this:

[ html]<iframe width="480" height="360" src="https://www.youtube.com/embed/9MUWkO7rq_c" frameborder="0" allowfullscreen></iframe>[ /html]

(but then with the spaces between the [...] removed, of course..)


Reply #2
on: Feb 28, 2016, 6:58 PM
Hero Member
Posts: 3,210 Joined: January 22, 2008

  • *****
  • Personal Text
    I keep trying so far... Hmm 😶‍🌫️ ☮️ 😎
That was a nice looking older Monti Carlo,Cop car? Yeah... Nice hack there.
Let's have a better day...?

Reply #3
on: Feb 29, 2016, 5:31 AM
Hero Member
Posts: 368 Joined: October 20, 2007

  • *****
Thanks Remko,
i tried that, but it is not working for me. Maybe you need some special permission for the html-tags to work?

Test:

<iframe width="480" height="360" src="https://www.youtube.com/embed/9MUWkO7rq_c" frameborder="0" allowfullscreen></iframe>

edit: the "html" code gets removed
« Last Edit: Feb 29, 2016, 5:35 AM by MADMAN_nfs »

Reply #4
on: Mar 01, 2016, 2:20 PM
Administrator Hero Member
Posts: 504 Joined: November 03, 2005

  • *****
Oh, I did not know that, sorry. I will check the settings and see why that is.

Reply #5
on: Mar 08, 2016, 2:39 PM
Hero Member
Posts: 368 Joined: October 20, 2007

  • *****
Any news regarding this matter?

Reply #6
on: Mar 14, 2016, 3:29 PM
Administrator Hero Member
Posts: 504 Joined: November 03, 2005

  • *****
Sorry for the wait, took a while before I found something. The html permission apparently cannot officially be changed, so after a while I found out that there's an alternative way. I needed to enable the 'Flash' button to the post options though, which is disabled in SMF by default. Enabling flash in forum posts supposedly poses a small security risk, but I don't think those risks are too great in a small community like ours.   ;)

It works like this: you take a standard Youtube page link like this one:
https://www.youtube.com/watch?v=nn6QoVb5s7U

No need to go to the embedding options or anything this time, but what you need to do is:
Take the part that goes /watch?v= and change it to /v/

So now the link becomes:
https://www.youtube.com/v/nn6QoVb5s7U

Then look for the new Flash button in the options: and place that link between Flash tags. By default is set at 200 x 200 pixels, but you can manually change that to, for example, '480,360' and you get this:

flash=480,360]https://www.youtube.com/v/nn6QoVb5s7U[/flash

Or, with the tags complete: ;)

https://www.youtube.com/v/nn6QoVb5s7U

Reply #7
on: Mar 15, 2016, 9:10 AM
Hero Member
Posts: 423 Joined: May 21, 2006

  • *****
  • Personal Text
    Ramms+ein fan
Sorry for the wait, took a while before I found something. The html permission apparently cannot officially be changed, so after a while I found out that there's an alternative way. I needed to enable the 'Flash' button to the post options though, which is disabled in SMF by default. Enabling flash in forum posts supposedly poses a small security risk, but I don't think those risks are too great in a small community like ours.   ;)[...]
Unless abused by a spambot or something... can the SWF functionality be limited to members with at least, say, 10 forum posts or so? Also, I am wondering whether HTML5 embedding is possible. Flash is obsolete and its player has seen SO many security issues the past months I removed it completely.

Reply #8
on: Mar 15, 2016, 3:11 PM
Administrator Hero Member
Posts: 504 Joined: November 03, 2005

  • *****
Sorry for the wait, took a while before I found something. The html permission apparently cannot officially be changed, so after a while I found out that there's an alternative way. I needed to enable the 'Flash' button to the post options though, which is disabled in SMF by default. Enabling flash in forum posts supposedly poses a small security risk, but I don't think those risks are too great in a small community like ours.   ;)[...]
Unless abused by a spambot or something... can the SWF functionality be limited to members with at least, say, 10 forum posts or so? Also, I am wondering whether HTML5 embedding is possible. Flash is obsolete and its player has seen SO many security issues the past months I removed it completely.

Hm, good point I guess... I don't know if this isp possible without installing mods, but I'll look into it. Thanks for the feedback.

Reply #9
on: Mar 16, 2016, 4:54 AM
Hero Member
Posts: 368 Joined: October 20, 2007

  • *****
Hey, thanks Remko for looking into this. I guess XJ220 is right there, enabling flash completely is probably a security risk.

Maybe think about what i tried to explain in the first post: Instead of the flash button, enable a youtube-button where you can only enter the video ID (11 characters). So the site automatically interpretes the characters written within, some brakets for example - and adds https://www.youtube.com/v/ in front of it.
Example:
[youtube]7aTT7hcVpN8[/youtube] or [yt]7aTT7hcVpN8[/yt] etc...
converts to:
https://www.youtube.com/v/7aTT7hcVpN8
If you can implement a check for this maximum of 11 characters and deny longer ID's, i can't see any security risks.
You get the idea i hope :)

Indeed, HTML videos would be better tho.

Greetings

 


Support NFSAddons: