Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Sesquipedalian on February 24, 2023, 07:14:49 PM

Title: Video Embed
Post by: Sesquipedalian on February 24, 2023, 07:14:49 PM
Link to the mod (https://custom.simplemachines.org/index.php?mod=4360)

Video Embed

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

Supported video hosting sites include:

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:

Version 1.1:

Version 1.0:
Title: Re: Video Embed
Post by: -Rock Lee- on February 25, 2023, 04:58:23 PM
It seems interesting more than it is directly implemented, I will comment any problem :).


Regards!
Title: Re: Video Embed
Post by: jsx on February 26, 2023, 08:00:42 AM
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.
Title: Re: Video Embed
Post by: Sesquipedalian on February 26, 2023, 12:17:10 PM
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;
}
Title: Re: Video Embed
Post by: jsx on February 26, 2023, 02:43:52 PM
Thank you for the information and help. 8)
Title: Re: Video Embed
Post by: 808server on October 14, 2023, 06:10:57 PM
Is this mod supposed to work with this tag?:

I installed it but keep getting an error,
Thanks
Title: Re: Video Embed
Post by: Aleksi "Lex" Kilpinen on October 15, 2023, 12:55:42 AM
See the difference?



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






[youtube]wgIB1OL09H0[/youtube]




That's the default 2.1 behaviour.
Title: Re: Video Embed
Post by: Sesquipedalian on October 15, 2023, 02:26:42 AM
@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.)
Title: Re: Video Embed
Post by: jsx on December 01, 2023, 02:15:20 PM
I get errors like this:

8: Undefined index: host

(https://i.imgur.com/jLOxi4j.png)

(https://i.imgur.com/du4gevj.png)

(https://i.imgur.com/PqyOwSZ.png)
Title: Re: Video Embed
Post by: Sesquipedalian on December 01, 2023, 05:28:09 PM
Thanks for the bug report, @jsx. The issue should be fixed in version 1.2. Please test to confirm, and then let me know.
Title: Re: Video Embed
Post by: CraftyLion on December 04, 2023, 04:35:24 PM
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 ...
Title: Re: Video Embed
Post by: Sesquipedalian on December 04, 2023, 04:38:06 PM
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.
Title: Re: Video Embed
Post by: CraftyLion on December 04, 2023, 04:41:36 PM
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.
Title: Re: Video Embed
Post by: Sesquipedalian on December 04, 2023, 04:49:02 PM
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.
Title: Re: Video Embed
Post by: Thistle Sifter on December 07, 2023, 01:26:57 AM
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:
Screenshot_20231207_165329_Firefox.jpg
Title: Re: Video Embed
Post by: Steve on December 07, 2023, 05:49:20 AM
Try this instead (for now):

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

Delete everything after and including the ? .
Title: Re: Video Embed
Post by: davo88 on March 16, 2024, 05:43:18 PM
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?
Title: Re: Video Embed
Post by: Sesquipedalian on March 17, 2024, 03:27:57 AM
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.