The PHPVibe cms uses a tone of web sources, through web sources people can easily generate a video autoembed by submitting just the link.
We will be using the logic of the plugins system to achieve a new source without touching the code from lib/class.providers.php
First, let’s add our new source to the supported array of websites.
function newSourceName($hosts = array()){
$hosts[] = 'newsource.com';
return $hosts;
}
And hook it with a simple filteradd_filter('vibe-video-sources', 'newSourceName');
Now let’s provide the embed logic:
function EmbednewSourceName($txt =''){
global $vid;
if(isset($vid)) {
if($vid->VideoProvider($vid->theLink()) == 'newsource.com' ) {
$link = $vid->theLink();
if(!nullval($link)) {
$id = $vid->getVideoId("video/", '/'); //* Id extraction logic. Let's say the url has the id after /video , example old.phpvibe.com/video/1367/ *//
if(!nullval($id)) {
$tembed = ' < iframe(? object, etc) width="' . get_option('video-width') . '" height="' . get_option('video-heigth') . '" src="http://newsource.com/player?vid='.$id.'" frameborder="0" allowfullscreen scrolling="no"> iframe(? object, etc) > ';
$txt .= $tembed;
}
/* End link check */
}
/* End provider check */
}
/* End isset(vid) */
}
/* End function */
return $txt;
}
So now we have the function which gets the link to the external video source and turns it into an iframe embed.
Let’s hook it to the PHPVibe embeds through the filter EmbedModify.add_filter('EmbedModify', 'EmbednewSourceName');
Now we have a new source of embeds for our visitors.
If you can scrape, or the source returns details (thumbnails, duration, title, description, tags), you can hook this also:
function DetailsnewSourceName($txt = ''){
global $vid,$websLink;
if(!isset($vid) && isset($websLink)) {
$vid = new Vibe_Providers($websLink);
}
if(isset($vid)) {
$link = $vid->theLink();
if(!nullval($link)) {
//* Logic to extract info from the link goes here and it's added to $txt *//
}
/* End isset(vid) */
}
/* End function */
return $txt;
}
The output expected is an array, example:
$video['description'] ='';
$video['title'] ='';
$video['thumbnail'] ='';
$video['duration'] ='';
$video['tags'] ='';
The function gets hooked to the filter EmbedDetails
add_filter('EmbedDetails', 'DetailsnewSourceName');
Now you will be returning video details on the second submission page.
please show me by video?
Hi. Please use the forum.
Hi
I want to buy this phpvibe theme I have seen phpvibe theme .this is good php theme but one Issue i seen in it. if any user or new person upload any video from youtube embed code them video didn’t plays sowing some error. so please check and make sure user can upload videos after that i will able to buy this theme
Hi! PHPVibe is not a theme. It is a full cms.
We’re looking into the issue.
Hi Vibe,
How can i edit for theme support multi source video per a post?
ex:
postid: 1
title: abc
source : [ youtobe1.com, facebook.com, vimeo.com]
So clients can choose which best site they can watch. or sometimes option 1 die they will watch the option 2.
can i do that?
Hi,
That feature doesn’t exist in the cms.
I’m wanting to allow users to embed videos from PHPvibe/MediaVibe into WordPress