MyBB Community Forums

Full Version: Need to add embed options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Having issues with Bitchute and Rumble embedding and populating.  If I modify the iframe files for the video embedding I can make it work easily. My problem is where to find the "options" files and amend them so I can use the functions i created.  I need to get them on the selections list.  Been looking for hours to find out where this table is nested and can't find the darn thing.


[attachment=45802]


What file is this table nested in?


Bill

Here is where I created the files to use this function.  Unless i can get to select them it does me no good...

[attachment=45803]
You have to extent in "/inc/class_parser.php" mycode_parse_video function this $video switch

and in "/jscripts/bbcodes_sceditor.js" this video array
(2023-02-21, 10:02 PM)SvePu Wrote: [ -> ]You have to extent in "/inc/class_parser.php" mycode_parse_video function this $video switch

and in "/jscripts/bbcodes_sceditor.js" this video array

Thank you.  Now I can finish this project...

(2023-02-21, 10:02 PM)SvePu Wrote: [ -> ]You have to extent in "/inc/class_parser.php" mycode_parse_video function this $video switch

and in "/jscripts/bbcodes_sceditor.js" this video array

I was premature...  I added to both but I am still unable to see the choice in the drop down menu...  Am I missing one more file?
You have to hard refresh your browser cache to fully reload the js file.
Is there a list call out for the selections somewhere? The JS will not allow more than 8 selections. where do I need to change this ?
What did you add, and where? Tell me and I will test here.
I've added 4 more items into video selector and it works Wink
[attachment=45808]
Here is the text i added to parsar:

case "twitch":
if(count($path) >= 3 && $path[1] == 'videos')
{
// Direct video embed with URL like: https://www.twitch.tv/videos/179723472
$id = 'video=v'.$path[2];
}
elseif(count($path) >= 4 && $path[2] == 'v')
{
// Direct video embed with URL like: https://www.twitch.tv/waypoint/v/179723472
$id = 'video=v'.$path[3];
}
elseif(count($path) >= 2)
{
// Channel (livestream) embed with URL like: https://twitch.tv/waypoint
$id = 'channel='.$path[1];
}
break;
case "rumble":
if($fragments[0])
{
$id = str_replace('!v=', '', $fragments[0]); // http://www.rumble.com/embed/
}
elseif($input['v'])
{
$id = $input['v']; // http://www.rumble.com/embed/
}
else
{
$id = $path[1]; // http://www.rumble.com/
}
break;
case "bitchute":
if($fragments[0])
{
$id = str_replace('!v=', '', $fragments[0]); // http://www.bitchute.com/embed/
}
elseif($input['v'])
{
$id = $input['v']; // http://www.bitchute.com/embed/
}
else
{
$id = $path[1]; // http://www.bitchute.com/
}
default:
return "[video={$video}]{$url}[/video]";
}

Here is what I added to bbcodes_screeneditor;

},
'Twitch': {
'match': /twitch\.tv\/(?:[\w+_-]+)\/v\/(\d+)/,
'url': '//player.twitch.tv/?video=v',
'html': '<iframe src="{url}" frameborder="0" scrolling="no" height="378" width="620" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Rumble': {
    'match': /(?:v=|v\/|embed\/|rumb\.le\/)(.{11})/,
'url': '//www.rumble.com/embed/',
'html': '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Bitchute': {
    'match': /(?:v=|v\/|embed\/|youtu\.be\/)(.{11})/,
'url': '//www.bitchute.com/embed/',
'html': '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
}
}
};

Couple of errors i caught..  here is the new file for JS

},
'Twitch': {
'match': /twitch\.tv\/(?:[\w+_-]+)\/v\/(\d+)/,
'url': '//player.twitch.tv/?video=v',
'html': '<iframe src="{url}" frameborder="0" scrolling="no" height="378" width="620" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Rumble': {
    'match': /(?:v=|v\/|embed\/|rumb\.le\/)(.{11})/,
'url': '//www.rumble.com/embed/',
'html': '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
},
'Bitchute': {
    'match': /(?:v=|v\/|embed\/|bitchu\.te\/)(.{11})/,
'url': '//www.bitchute.com/embed/',
'html': '<iframe width="560" height="315" src="{url}" frameborder="0" data-mybb-vt="{type}" data-mybb-vsrc="{src}"></iframe>'
}
}

(2023-02-22, 06:33 PM)SvePu Wrote: [ -> ]I've added 4 more items into video selector and it works Wink

Ok... did I code it incorrectly?

Here are the files

[attachment=45809][attachment=45810]

Most sites now provide the embed code string.  Thinking about adding one more option where you drop the embed code string rather than just the url alone.  Hmmm...  options to make this a global fix.

<iframe class="rumble" width="640" height="360" src="https://rumble.com/embed/v27w06c/?pub=o339l" frameborder="0" allowfullscreen></iframe>

by simply creating a drop point, for the post to insert the video embed code into the html any code string could be used to embed.

I did it in my developer software using my website. 

[attachment=45811]

Fixed population problem. Progress.

I am not well versed in the code, so I am making syntax errors. Learning by failure..

Now trying to figure out why I am getting subframe errors and failure to connect.

When I attach a url the player appears in the draft and functions. when I post the comment, it goes to connection errors... Seems like i have duplicated something and that is what is crashing the embed.
Assuming your video_rumble_embed template is like this
<iframe width="640" height="360" src="https://rumble.com/embed/{$id}" frameborder="0" allowfullscreen></iframe>

and your rumble url (remember that your members will be providing it and entering it in the post using the video dropdown) and it is of the form https://rumble.com/embed/v27qrst/?pub=0399l, the class_parser code should be returning $id=$path[2]; (which works) or $id=$path[2] . "/?" . $queries[0]; (which also works).

Since you haven't identified the different variations of a valid rumble video url, the first two conditions are meaningless.

You should provide more details of what valid twitch and bitchute urls are.
(2023-02-23, 01:18 AM)HLFadmin Wrote: [ -> ]Assuming your video_rumble_embed template is like this
<iframe width="640" height="360" src="https://rumble.com/embed/{$id}" frameborder="0" allowfullscreen></iframe>

and your rumble url (remember that your members will be providing it and entering it in the post using the video dropdown) and it is of the form https://rumble.com/embed/v27qrst/?pub=0399l, the class_parser code should be returning $id=$path[2]; (which works) or $id=$path[2] . "/?" . $queries[0]; (which also works).

Since you haven't identified the different variations of a valid rumble video url, the first two conditions are meaningless.

You should provide more details of what valid twitch and bitchute urls are.

Twitch was left there from original code. I left it for reference. 
I am learning to code.  this is all new to me but i am learning fast. 
As far as bitchute urls...

Fireside Chat Ep. 209 — Everything in Life Is a Choice (bitchute.com)   

https://www.bitchute.com/video/JGkETcyLYVk/ 

They are straight forward.

(2023-02-23, 01:18 AM)HLFadmin Wrote: [ -> ]Assuming your video_rumble_embed template is like this
<iframe width="640" height="360" src="https://rumble.com/embed/{$id}" frameborder="0" allowfullscreen></iframe>

and your rumble url (remember that your members will be providing it and entering it in the post using the video dropdown) and it is of the form https://rumble.com/embed/v27qrst/?pub=0399l, the class_parser code should be returning $id=$path[2]; (which works) or $id=$path[2] . "/?" . $queries[0]; (which also works).

Since you haven't identified the different variations of a valid rumble video url, the first two conditions are meaningless.

You should provide more details of what valid twitch and bitchute urls are.

so, I should have used 0 or 2 in those locations.?  That is a change i can make easily. Here are the two variations for Rumble

https://rumble.com/embed/v27w06c/?pub=o339l

https://rumble.com/v2ahg0o-the-fbi-is-co...l&mc=bwzhl
Pages: 1 2