Videos from Facebook or YouTube
Videos from Facebook or YouTube
Hi there
I am looking for a way to make videos run on FlatPress .. until now, noting works.
Thanks in advance for any answer.
Regards
EYUman
I am looking for a way to make videos run on FlatPress .. until now, noting works.
Thanks in advance for any answer.
Regards
EYUman
Re: Videos from Facebook or YouTube
Hi, welcome to the FlatPress support forum
I have no experiences with Facebook videos (anyone else?), but as for Youtube, it's as simple as that:
See also the BBCode documentation on our wiki: https://wiki.flatpress.org/doc:plugins:bbcode
Regards,
Arvid
I have no experiences with Facebook videos (anyone else?), but as for Youtube, it's as simple as that:
Code: Select all
[video=https://www.youtube.com/watch?v=mIGfest1b1M]
Regards,
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Videos from Facebook or YouTube
Replace the script from line 332 in fp-plugin/bbcode/plugin.bbcode.php with this
You have support for youtube, vimeo, facebook and html5 (for mp4 you must set the type like in the exemple).
I hope to find a way to auto recognize html5 videos and I will send all in github.
Code: Select all
function do_bbcode_video($action, $attr, $content, $params, $node_object) {
if ($action == 'validate') {
return true;
}
$vurl = parse_url($attr['default']);
if (isset($attr['type'])) {
$type = $attr['type'];
} else {
// is it http://www.MYSITE.com or http://MYSITE.com ?
$web = explode('.', $vurl['host']);
array_pop($web);
$type = isset($web[1])
? $web[1]
: $web[0];
}
$color = isset($attr['color'])
? $attr['color']
: '';
$width = isset($attr['width'])
? $attr['width']
: '560';
$height = isset($attr['height'])
? $attr['height']
: '315';
$allowfs = isset($attr['allowfullscreen'])
? $attr['height']
: 'allowfullscreen';
$float = isset($attr['float'])
? "align=\"{$attr['float']}\" "
: "style=\"margin: 0 auto; display:block;\" ";
$query = utils_kexplode($vurl['query'], '=&');
$the_url = null;
$others = '';
switch ($type) {
case 'html5':
$the_url = "<video style=\"display:block; margin: 0 auto;\" width=\"{$width}\" height=\"{$height}\" controls>"
."<source src=\"".$attr['default']."\">"
."Your browser does not support the video tag."
."</video>";
break;
case 'youtube':
$the_url = "<iframe src=\"https://www.youtube.com/embed/{$query['v']}\" width=\"{$width}\" height=\"{$height}\" frameborder=\"0\" allow=\"accelerometer; autoplay; fullscreen; encrypted-media; gyroscope; picture-in-picture\" {$float}></iframe>";
break;
case 'vimeo':
$vid = isset($query['sec'])? $query['sec'] : str_replace('/', '', $vurl['path']);
$the_url="<iframe src=\"https://player.vimeo.com/video/{$vid}?color={$vid}&title=0&byline=0&portrait=0\" width=\"{$width}\" height=\"{$height}\" frameborder=\"0\" allow=\"autoplay; fullscreen;\" allowfullscreen {$float}></iframe>";
break;
case 'facebook':
$vid = isset($query['sec'])? $query['sec'] : str_replace('/video/', '', $vurl['path']);
$the_url="<div id=\"fb-root\"></div>
<script async defer src=\"https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2\"></script>
<div class=\"fb-video\" data-href=\"{$vid}\" data-allowfullscreen=\"true\" data-width=\"{$width}\"></div>";
break;
case 'default':
default:
$the_url = null;
}
if ($the_url) {
return $the_url;
}
return '[unsupported video]';
}
Code: Select all
youtube:
[video=https://www.youtube.com/watch?v=15nPDcuqDTI]
html5:
[video=https://media.w3.org/2010/05/sintel/trailer.mp4 type=html5]
vimeo:
[video=https://vimeo.com/96867408]
facebook:
[video=https://www.facebook.com/facebook/videos/10153231379946729/]
Re: Videos from Facebook or YouTube
Hello there, hello vodka,
I replaced the script from line 332 in fp-plugin/bbcode/plugin.bbcode.php with your code and I got Error 500...
Nothing to see anymore behalve the Error 500 script error ..
Whats wong now?
I installed the flatpress-master which was offered here in an other thread .. :
Well, I changed it back to the origin file, now the website is running again, but there is no possibility to run any other video URL than You Tube.
Regards
B-d-R-D
I replaced the script from line 332 in fp-plugin/bbcode/plugin.bbcode.php with your code and I got Error 500...
Nothing to see anymore behalve the Error 500 script error ..
Whats wong now?
I installed the flatpress-master which was offered here in an other thread .. :
And now I try to get my website running again ...Re: White screen after setup of Flatpress
Beitrag von LubomΓr LudvΓk Β» Mi Feb 20, 2019 9:05 pm
try dev version 1.1 https://github.com/flatpressblog/flatpr ... master.zip
Well, I changed it back to the origin file, now the website is running again, but there is no possibility to run any other video URL than You Tube.
Regards
B-d-R-D
Regards B-d-R-D
Re: Videos from Facebook or YouTube
You must replace only the lines for the function (from 332 to 373)
Re: Videos from Facebook or YouTube
Thanks, Vodka!
Modified code as stated, and works well. Thanks for the patch.
Rick
Modified code as stated, and works well. Thanks for the patch.
Rick
Re: Videos from Facebook or YouTube
Thank you vodka, this is very useful. I slightly adapted your code and added it to the FP sources.
To be mentioned: It does not support uploaded video files yet - please refer to the the Audio and video player plugin in this case. Maybe we could unify this later.
To be mentioned: It does not support uploaded video files yet - please refer to the the Audio and video player plugin in this case. Maybe we could unify this later.
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Videos from Facebook or YouTube
I've tried to use this plugin in the past, but no matter the URL of the audio all I get is an error saying "Given file does not exist.", when it 100% does. Any ideas?Arvid wrote: βMon Oct 07, 2019 3:07 pm To be mentioned: It does not support uploaded video files yet - please refer to the the Audio and video player plugin in this case. Maybe we could unify this later.
Re: Videos from Facebook or YouTube
Did you enter the correct path to the file?
See this entry on my personal blog, where I included the video like this:
The "audioplayer" tag works the same way.
Do you have the "attachs" folder in your video path? (If that doesn't help, please give us the link to your site and to the audio file, so we can test it together.)
All the best,
Arvid
See this entry on my personal blog, where I included the video like this:
Code: Select all
[videoplayer="attachs/2018-06-30_haldehoheward.mp4" width="640" height="360"]
Do you have the "attachs" folder in your video path? (If that doesn't help, please give us the link to your site and to the audio file, so we can test it together.)
All the best,
Arvid
Project blogββ Docsββ Twitterββ Mastodonββ Forum RSS feedββ Project blog RSS feedββ Donate
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
FlatPress 1.3 "Andante" is released!
How to rework your themes and plugins for FlatPress 1.3 / Smarty 4
Re: Videos from Facebook or YouTube
Ah, if everything needs to be in a certain folder then I'll just use regular HTML5 player code for playing files. Thanks anyway.Arvid wrote: βMon Jun 01, 2020 2:35 pm Did you enter the correct path to the file?
See this entry on my personal blog, where I included the video like this:The "audioplayer" tag works the same way.Code: Select all
[videoplayer="attachs/2018-06-30_haldehoheward.mp4" width="640" height="360"]
Do you have the "attachs" folder in your video path? (If that doesn't help, please give us the link to your site and to the audio file, so we can test it together.)
All the best,
Arvid
Who is online
Users browsing this forum: No registered users and 29 guests