PDA

View Full Version : vBulletin CMS Widgets - Random YouTube/Vimeo Video Widget


imported_dfmafia
07-26-2012, 10:00 PM
Random YouTube Video Widget

Description: Allows you to display 1 random video from any number of videos you choose.

Tested on vB 4.2.0 Patch Level 2

Live Demo: MrDeids.com (http://mrdeids.com)

https://vborg.vbsupport.ru/attachment.php?attachmentid=140145&stc=1&d=1343421739

https://vborg.vbsupport.ru/attachment.php?attachmentid=140148&stc=1&d=1343427292


Installation:
1. Download Random_Video_Widget_v1.0.1.zip
2. Unzip contents and view README
3. Go To -> Admincp -> vBulletin CMS -> Widgets
4. Create new widget
Widget Type: Static HTML. Name it whatever you desire. ie. "Random Video"and save it.
5. Configure The Widget in VBulletin CMS -> widgets (insert all the code in the Random_Video_Widget_v1.0.1.txt making edits highlighted in red to suit your site)
6. Add the widget in page through layout manager.

Uninstallation:
Delete "Random Video" (or whatever you named it) Widget in vBulletin CMS -> Widgets

The RED items below will need to be edited to suit your requirements.

video[0] = "http://www.youtube.com/embed/s7-pbVdiDas";

s7-pbVdiDas is the Video link you can get from your youtube channel.
ie. http://www.youtube.com/watch?v=s7-pbVdiDas


this is the total number of videos you want to pull from your youtube channel list
var numberOfVideos = 12;


adjust for height and width of your layout.
width="340" height="280"


I do not have a Vimeo account but it should work the same way.
for vimeo use:
video[0] = "http://player.vimeo.com/video/XXXXXXXX?title=0&byline=0&portrait=0";

XXXXXXXX is the Video link you can get from your vimeo video id.

Please Click Mark As Installed If You Have Installed.

Mod History:
v1.0.0 :: 27 July 2012 :: First Release
v1.0.1 :: 28 July 2012 :: Added Vimeo Support

ProFifaLeagues
07-27-2012, 09:36 PM
Nice one m8 thank you will be useful in the coming weeks for us

imported_dfmafia
07-28-2012, 12:19 AM
UPDATED:

for vimeo use:
video[0] = "http://player.vimeo.com/video/XXXXXXXX?title=0&byline=0&portrait=0";

XXXXXXXX is the Video link you can get from your vimeo video id.

Brew
08-03-2012, 05:47 PM
I don't get it :)

How does the mod randomize videos if I only put the number of the video in the string?

Is there a way to set it up so it will randomly take a video from a channel?

Like say, a video from the CNN Youtube channel, then one from the Fox News channel, then one from MSNBC channel?

If this doesn't do that will you please consider making that happen?

Cheers!

imported_dfmafia
08-03-2012, 11:41 PM
I haven't found a clean way to pull random videos from multiple channels. would be nice and something I am looking into.

This pulls a random video out of the list you provide. you can put as many videos links into it as you want. It will pull one of those videos randomly during each page load.

I have 12 on my channel. as I upload more videos, I just add that new video to the script. I'd rather have some control over the content of my site than pulling random videos from multiple channels.

Brew
08-04-2012, 03:12 AM
Since I have a political web site I need to be able to post the newest stuff from the news sites. They update their stuff daily so I can't keep track of which things I'll put into this mod.

Even if you had it for one channel would be ok. Then add a randomizer conditional for the other sites.

Just a thought :)

imported_dfmafia
08-04-2012, 03:18 AM
I'll look into it.

Syxguns
08-15-2012, 02:38 AM
I tagged it, the widget looks nice, but being able to pull from certain channels would be perfect.

imported_dfmafia
09-11-2012, 12:02 AM
I haven't forgotten this. I've been busy coding sites. When I get some free time, I'll reattack this.

alhidaya
10-16-2012, 06:18 AM
The installation of video work.. When you refresh the page cms, represent several videos and they do not go on video [0], vidéo [1], vidéo [2], vidéo [3] etc... Mais elles font se représentent par exemple : vidéo [0], vidéo [1], vidéo [1], vidéo[1], vidéo[2], vidéo[3], vidéo[1], vidéo[4],... The videos don't follow every time we refreshes the page.

imported_dfmafia
10-16-2012, 06:30 AM
this is correct. they will not display in order, 1,2,3,4...
its random and will pull a video out randomly from the videos you have listed.

you may see one video pop up more than once in a row. its all random

Barbara1
01-29-2013, 05:18 PM
is there a way to make the videos autoplay on load?

marccap
02-11-2013, 08:15 PM
Doesn't appear to work at all on 4.2 Level 3

Ba'al
05-20-2013, 10:20 PM
Doesn't appear to work at all on 4.2 Level 3
Its working fine for me in 4.2.0 pl 3

Toorak Times
05-23-2013, 11:57 AM
I'll give it a go on 4.2.1

Barakat
08-14-2013, 09:47 AM
love it ,,, works on 4.2.1 .. thanks

rossonero
01-26-2014, 05:46 PM
I try to insert a youtube video like: https://www.youtube.com/watch?v=noPVhgEVStE

It doesn?t Work? a error message just appear that the site can not be displayed. If I insert the youtube links you have as example it Works fine

rossonero
01-26-2014, 06:11 PM
Strange - now and then it load the youtube video in the window if you wait a bit. But mostly just default Explorer setting that "site can not be displayed"

Ba'al
01-27-2014, 03:57 PM
Strange - now and then it load the youtube video in the window if you wait a bit. But mostly just default Explorer setting that "site can not be displayed"
Are entering the youtube video url or the video share url?

Linkeb3
04-03-2015, 01:57 PM
Is this setup to play random videos within a channel?

oldfan
06-06-2023, 07:37 PM
working great as a block on 4.2.6. php 7.2.

https://metallifukinca.com/forum/forum.php