Firefox PHP

Module: BBcode Video

Posted by Maurice Makaay 
Re: Module: BBcode Video
August 25, 2014 03:57PM
I am not sure that is a minor fix. It also creates a problem for when everything is https, and is not available http.

Are the videos playing in your Phorum message, rather than in a new window or tab? What happens if you open the video in a new window or tab?

Is the browser blocking the content, because the content on your page comes from two different domains.
Or
Some secure, some not?
Re: Module: BBcode Video
August 25, 2014 04:24PM
Thanks for the quick response. Hopefully this answers your question.

For example, this BB-code

[video]https://www.youtube.com/watch?v=_sgfWiJPNUc[/video]

shows this...



but this....

[video]http://www.youtube.com/watch?v=_sgfWiJPNUc[/video] <same link without the s. Shows the actual video embedded fine on the site.

This is always an issue for all youtube links since by default the share link is https:, so even forcing the s out of youtube only links would work most of the time.
Re: Module: BBcode Video
September 03, 2014 02:07PM
Is anyone else unable to make https vids embedded or am I the lucky lone cricket in the room? Can someone please test it on their forum?
Re: Module: BBcode Video
September 04, 2014 12:00AM
The code in this file "bbcode_video.php" is not set up to detect https anything, It is hard coded to http.

If you change the hard coded links, you tube videos embed.
Re: Module: BBcode Video
September 05, 2014 12:32PM
^Thank you Scott!

For the fix I added this code to the file "bbcode_video.php"

	$search[] = "/[video\]https:\/\/(\w+\.)?youtube.com\/watch\?v=([\w_-]+)[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%#]*[\/video\]/is";
    $replace[] = "[video]youtube:$2[/video]";

directly underneath this code...

	$search[] = "/[video\]http:\/\/(\w+\.)?youtube.com\/watch\?v=([\w_-]+)[a-z0-9;\/\?:@=\&\$\-_\.\+!*'\(\),~%#]*[\/video\]/is";
    $replace[] = "[video]youtube:$2[/video]";

If anyone is listening I'd recommend this be added to the next release version since MOST if not all youtube links when copied from Youtube start with "https:"



Edited 1 time(s). Last edit at 09/05/2014 12:36PM by rchecka.
Re: Module: BBcode Video
September 18, 2014 03:13PM
I think I just changed all the "/[video\]http" to "/[video\]https?" for all url patterns in bbcode_video.php a long time ago

The "s?" means the regular expression (regex) will match an optional s

Skye

___
Skye Nott
Corvus Digital
Re: Module: BBcode Video
July 27, 2015 08:04PM
Anybody know how to modify the code so that youtu.be links work? Been taking a whack at it and so far have not been successful.
Re: Module: BBcode Video
July 28, 2015 11:00AM
Look at this topic and see if it is helpful. (Note, even though it has the same topic title, it is in the Phorum 5.1 Modules..

[www.phorum.org]
Re: Module: BBcode Video
July 29, 2015 03:23PM
Quote
ToddUGA
Anybody know how to modify the code so that youtu.be links work? Been taking a whack at it and so far have not been successful.

I added this to phorum_mod_bbcode_video_format()

Language: PHP
$search[] = "/\[video\]https?:\/\/youtu.be\/([\w_-]+)\[\/video\]/is"; $replace[] = "[video]youtube:$1[/video]";

and this to the "handle_plain_urls" conditional section just below

Language: PHP
$search[] = "/https?:\/\/?youtu.be\/([\w_-]+)/is"; $replace[] = "[video]youtube:$1[/video]";

___
Skye Nott
Corvus Digital
Re: Module: BBcode Video
September 14, 2015 04:55AM
For some reasons video is not working. Module is installed and is on. Video icon shows in the menu. But still shows the Youtube web address.
Sorry, only registered users may post in this forum.

Click here to login