News:

Join the Facebook Fan Page.

Main Menu

Video Embed

Started by Sesquipedalian, February 24, 2023, 07:14:49 PM

Previous topic - Next topic

Sesquipedalian

Link to the mod

Video Embed

A modification for SMF 2.1 that expands support for embedding videos from video hosting sites.

Supported video hosting sites include:
  • YouTube
  • Vimeo
  • Locally hosted video and audio files

BBCodes are added for each of the supported video hosting sites.

SMF's default YouTube editor toolbar button is replaced with a generic Video button that will automatically detect video URLs from the supported video hosting sites.

Future versions of this modification may expand support to include other video hosting sites, but I promise you nothing.

This modification is also backward compatible with BBCodes created by several older YouTube and Vimeo modifications. So if you previously used a modification to add YouTube or Vimeo support to SMF 2.0.x and then upgraded your forum to SMF 2.1.x, this modification might fix any broken embed codes in your pre-existing posts. (Note: BBCode parameters from older modifications may be ignored.)


Settings

There are no settings. Install to enable, uninstall to disable.


License

Video Embed is released under the MIT License. A full copy of this license is included in the package file.


Changelog

Version 1.2:
  • Avoids "Undefined index: host" error when processing malformed YouTube URLs.

Version 1.1:
  • Expands backward compatibility support for old YouTube mods that used the form https://youtu.be/4vuW6tQ0218.

Version 1.0:
  • Initial release
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

-Rock Lee-

It seems interesting more than it is directly implemented, I will comment any problem :).


Regards!
¡Regresando como cual Fenix! ~ Bomber Code
Ayudas - Aportes - Tutoriales - Y mucho mas!!!

jsx

Nice to see another mod for SMF 2.1, thanks for this mod. :)

Inserted video using this feature in SMF 2.1 is small. I think in SMF 2.1 and in this modification lacks the function to set the width and height of the video.

Sesquipedalian

Quote from: jsx on February 26, 2023, 08:00:42 AMInserted video using this feature in SMF 2.1 is small. I think in SMF 2.1 and in this modification lacks the function to set the width and height of the video.

That is controlled by SMF's index.css file. If you want the inserted videos to be wider, find the following in index.css and change the max-width to a value that you prefer:

.videocontainer {
max-width: 560px;
}
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

jsx

Thank you for the information and help. 8)

808server

Is this mod supposed to work with this tag?:

I installed it but keep getting an error,
Thanks

Aleksi "Lex" Kilpinen

See the difference?



[youtube]https://youtu.be/wgIB1OL09H0[/youtube]






[youtube]wgIB1OL09H0[/youtube]




That's the default 2.1 behaviour.
Slava
Ukraini!


"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Sesquipedalian

@808server: Version 1.1 adds support for that YouTube URL format.

@Aleksi "Lex" Kilpinen: A secondary feature of this mod is that it provides backward compatibility support for BBCodes created by several old YouTube BBCode mods that used different syntaxes than SMF 2.1's standard syntax. (New YouTube BBCodes will always use the standard syntax, of course. This mod merely adds the ability to parse pre-existing ones that used alternative syntaxes.)
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

jsx

I get errors like this:

8: Undefined index: host






Sesquipedalian

Thanks for the bug report, @jsx. The issue should be fixed in version 1.2. Please test to confirm, and then let me know.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

CraftyLion

I've just uploaded this package to embed an audio into my forum and it just comes up with this:

[b]http://forum.craftylion.com/media/craftylion_xmas.mp3[/b]
Now, I can't delete/edit it ...

Sesquipedalian

What steps did you follow to try to embed the audio file?

Also, if you can't edit the post, you have other issues going on.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

CraftyLion

I just used the embed button. Unfortunately, I embedded the wrong url and now I can't delete the embedded file.

https://forum.craftylion.com/index.php?topic=8.msg8#msg8

Edit: Never mind. I worked out I can delete using the "Quick Edit" button instead of the "Modify" link.

Sesquipedalian

To remove the embed, just edit the post and delete the [audio] BBCode. You should be able to do that easily enough in WYSIWYG mode, but if you're having trouble, try switching the editor to Source mode so that you can see (and remove) the raw BBCode.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Thistle Sifter

I just installed this and noticed that the conditionals at line 57 and below get tripped up by youtube.be URLs that also have a query string.

For example, this:
[youtube]https://youtu.be/LLcdqyDv2-s?si=vnEVS8ETZ37g8L2y[/youtube]
Results in the following error:
You cannot view this attachment.

Steve

Try this instead (for now):

https://www.youtube.com/watch?v=LLcdqyDv2-s

Delete everything after and including the ? .
DO NOT pm me for support!

davo88

I'm in the process of converting a 2.0.19 forum to 2.1.4 and considering this mod to handle display of YouTube video links in the 2.1.4 site.
In 2.0.19, they were handled by Simple Audio Video Embedder. But all mods will be removed and the database cleaned prior to conversion to 2.1.4.

YouTube links in the cleaned database appear in a variety of forms such as:
https://youtu.be/jgAvqH57Exk
www.youtube.com/watch?v=on1ikSOn6r4
http://www.youtube.com/watch?v=HKEuzxC4eGc
http://uk.youtube.com/watch?v=NFVdhHDd6d8
https://www.youtube.com/watch?v=RRhgZwU8FbE&feature=youtu.be
https://youtube.com/shorts/pT6LAv71oNs

I have installed this Video Embed mod on a test forum but it hasn't converted the existing links to the format it requires. A database search and replace for each style of link is the only way I can think of doing it. So I'm wondering how other people have have handled conversion of existing links in their databases?

Sesquipedalian

You appear to have misunderstood the function of this mod. It does not handle autolinking plain text URLs. If those URLs that you gave as examples were wrapped in [youtube][/youtube] BBC tags, then this mod could work with them. In contrast, detecting URLs that are not wrapped in BBC tags is a different task altogether. The SAVE mod is available for SMF 2.1 and it already handles autolinking plain text URLs nicely, so there's no need for this mod to reinvent it.
I promise you nothing.

Sesqu... Sesqui... what?
Sesquipedalian, the best word in the English language.

Advertisement: