Video Plus - Embed Videos from Popular Web Hosts

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools
Video Plus - Embed Videos from Popular Web Hosts
Developed by Yankidank Yankidank is offline
Developer Last Online: Mar 2010 Show Printable Version Email this Page
Designed for: Pligg 1.0.1
License: Creative Commons Attribution-Noncommercial-Share
Released: 04-03-2009
Last Update: 07-26-2009
Installs: 157
Supported by Author
Uses Module System
Template Edits Not Required
Can Reuse Source Code
Includes Files to Upload
Translations Accepted
Uses Third Party Websites
Download Certified
The latest version of Video Plus will automatically embeds videos from popular video hosting sites onto your website. A thumbnail appears next to articles that submit a supported website. When a user clicks on that thumbnail it pops up an ajax box with an embedded video. The embedded video and thumbnail are automatically inserted into your post by analyzing the url submitted in Submit Step 1. This module makes it SUPER EASY to let your users post videos to your Pligg website. Since users do NOT have to paste in embed code at any point you are making it easier for them, and more secure for your site.

If you are interested in adding additional video hosts to this module please read my second post which details how this module works. As mentioned in that post, not all video hosts are going to be compatible with this module.

Please consider making a donation if you use this module on your website so that we can continue to provide free modules like this one. Our goal is to raise $500 for this module in a years time. You can use the Chipin widget to the left to make a donation. Keep in mind that we could have kept this module as a Pligg Pro shop item and sold it, but we were hoping that donations would cover the cost of developing this module.

Why did I choose Lightview?
Quite simply, it was probably the best option for displaying multimedia content in a lightbox. Most of the other choices were either limited in their features or had the same problem with audio not stopping when you closed the ajax box. There were some other choices that all cost a lot more to run them legimately on your site, but I think that $4 USD is a fair price for something that will enhance your site. I suggest you try it out before buying though just to make sure that it does indeed work and doesn't break your site if you are using other javascript on your web page. This includes websites using the Wistie category dropdown menu on IE6 which requires jQuery.

If you are interested in trying this version out just grab the Video_Plus + Lightview file attached to this thread. I will not be providing any additional documentation than what is currently provided with the module since it is a commercial script that doesn't support me in any way. I suggest that you check out the documentation provided on the Lightview homepage for help. Please remember though that the original author is not responsible for supporting this Pligg module.

Supported Video Hosts:
  1. blip.tv
  2. cnn.com
  3. colbertnation.com
  4. collegehumor.com
  5. comedycentral.com
  6. funnyordie.com
  7. guba.com
  8. icefilms.info
  9. jumpcut.com
  10. keezmovies.com
  11. liveleak.com
  12. livevideo.com
  13. magavideo.com
  14. metacafe.com
  15. own3d.tv
  16. putfile.com
  17. redtube.com
  18. reuters.com
  19. revver.com
  20. spike.com
  21. stagevu.com
  22. thedailyshow.com
  23. thenewsroom.com
  24. vbox7.com
  25. vids.myspace.com
  26. video.google.com
  27. vimeo.com
  28. veoh.com
  29. youare.tv
  30. youtube.com

Installation Instructions:
  1. Download the .zip attachment
  2. Unzip it to your computer.
  3. Upload the /modules folder into your Pligg root. This will add 2 Pligg modules to your site, Lightview and Video Plus.
  4. Navigate to Admin > Modules and install the Lightview module
  5. After installing Lightview install the Video Plus module.
  6. From now on when someone submits a url in submit step 1 from a website that this module supports, it will automatically add an image that users can click on that will pop up an embedded video.
  7. Mark as Installed to receive an email or private message when an update is released.
Requirements:

Lightview Module version 0.2 or above
This is included with the Video Plus download. Lightview is needed for the video popup javascript effect. If you want you can use another javascript library to popup the videos, but you will need to remove the requirement line from /modules/video_plus/video_plus_install.php and customize the /modules/video_plus/templates/video_plus_index.tpl file so that it fits your alternate javascript style.

Other Notes:

If a thumbnail-supported URL is entered into submit step 1, thumbnails should be automatically be displayed in your template. Youtube offers a total of 4 static images that can be used to insert into your template. We have assigned all 4 images as template variables that you can use in your link_summary.tpl or video_plus_index.tpl files. Below are examples of each of the template tags followed by a brief description.
  1. <img src="{$video_thumbnail_large}" /> produces the one and only large 320x240 pixel thumbnail
  2. <img src="{$video_thumbnail}" /> produces the first 120x90 pixel thumbnail
  3. <img src="{$video_thumbnail_2}" /> produces the second 120x90 pixel thumbnail
  4. <img src="{$video_thumbnail_3}" /> produces the third 120x90 pixel thumbnail
Example thumbnails from a Youtube video in the same order as shown above:





----------------------

Examples:

You can also take a look at the attached screenshots that demonstrate what an activated video popup looks like and what a story page looks like when a large Youtube thumbnail is displayed.

Changelog:

Version 1.2
  • Added Funnyordie.com.
  • Removed an extra double-quote ( " ) in the template file.
  • The module will now use Lightview instead of jQuery. It seems to be a more popular solution, but please remember to donate to the Lightview author.
Version 1.1
  • Added Redtube.com and Keezmovies.com, including screenshot thumbnails.
Version1.0
  • Added own3d.tv, including screenshot thumbnails.
Version 0.9
  • CNN and Reuters updates. Both services have slightly changed URLs. The video thumbnail will also now only apply to CNN and Reuters video pages, not their normal articles that don't contain any videos.
Version 0.8
  • Youtube now autoplays. Added IceFilms.
Version 0.7
  • Added video thumbnails for Metacafe and Vimeo. Each site that offers thumbnails handles it in a different way so they don't match the Youtube 3 thumbnail option.
Version 0.6
  • Added CNN.com, CBSnews.com and JumpCut.com
Version 0.5 (updated jQuery module too)
  • Added Reuters.com, TheNewsRoom.com, ColbertNation.com, ComedyCentral.com and TheDailyShow.com.
  • Updated version number
  • Added homepage and update url to install script. Please reinstall module to see changes on module admin page.

Download Now

File Type: zip video_plus_1.1.zip (125.8 KB, 1084 views)
File Type: zip Video_Plus + Lightview 1.2.zip (60.3 KB, 1201 views)

Screenshots

File Type: png video_plus.png (58.6 KB, 684 views)
File Type: png video_plus_single.png (81.8 KB, 527 views)

License Agreement

Creative Commons Attribution-Noncommercial-Share Alike License
You are free to Share and Remix this work under the following conditions: You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
You may not use this work for commercial purposes.
If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

Supporters / CoAuthors

Show Your Support

  • If you like this download support the author by donating.
  • This download may not be copied, reproduced or published elsewhere without author's permission.

Similar Downloads
Download Developer Category Replies Last Post

Comments
  #2 (permalink)  
Old 04-03-2009, 12:53 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,803
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Adding New Video Hosts
Not all video websites are compatible with this module, in fact it might be as few as half of the sites out there will work. This module was designed on the basic idea that some video hosts insert a video ID in the url for a video that is often used in the embed code to embed the video. The module figures out the ID from the URL and then uses that ID in the embed code to insert the videos into the popup area.

If you open up /modules/video_plus/video_plus.php you will quickly realize how the code works. Looking at the below example I will analyze how the video ID is grabbed from a youtube URL and then inserted into the youtube embed code.

Step 1
Find a youtube video that you want to post. Analyze that url. See that ending segment with the alphanumeric ID?
Code:
http://www.youtube.com/watch?v=PN2HAroA12w 
Step 2.
Lets look at the embed code for that video.
Code:
<object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/PN2HAroA12w&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/PN2HAroA12w&hl=en&fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object>
As you can see the ID from the url is used in the embed code. There also doesn't seem to be any random characterts inserted in the embed code to make it difficult to automatically find the source (embed src) of the video. Many video sites insert random alphanumeric characters into the src value which prevents this module from being compatible with them.

Step 3
Open up /modules/video_plus/video_plus.php. Find an existing video host that has a similar url structure and copy/paste it so that you can work from a copy of it to insert your new video host. In this example I will be copy/pasting the Vimeo code since it's pretty close to the youtube url structure (their url ends with and ID)

Code:
    // code to display Vimeo WWW
    if (preg_match("/http:\/\/www.vimeo.com\/([0-9a-zA-Z\-\_]*)/i", $url, $matches)) {
        return '<object width="700" height="415">'.
                    '<param name="movie" value="http://vimeo.com/'.$matches[1].'" />'.
                    '<param name="allowfullscreen" value="true" />'.
                    '<embed src="http://www.vimeo.com/moogaloop.swf?clip_id='.$matches[1].'" quality="best" scale="exactfit" width="700" height="400" type="application/x-shockwave-flash" />'.
                '</object>';
    }
Now I will begin modifying the second line to match youtube.
Code:
    if (preg_match("/http:\/\/www.youtube.com\/watch\?v=([0-9a-zA-Z-_]*)/i", $url, $matches)) {
{
Notice how a forward slash ( \ ) is placed before the question mark and forward slash ( ? and / ).
([0-9a-zA-Z-_]*) is being used to replace the video ID from the url. If the video ID uses special characters like a forward slash you should use (.*).
As a final step to this line we will be adding (.*) after that video ID code so that if the url has extra information included (like what site pointed to the url) it will not assign that as part of the ID.

Next I will replace the return variable with one to match Youtubes embed structure. I will then change the size to match our 700x400 popup window.
Code:
        return '<object width="700" height="400">'.
               '<param name="movie" value="http://www.youtube.com/v/'.$matches[1].'" />'.
               '<param name="wmode" value="transparent" />'.
               '<embed src="http://www.youtube.com/v/'.$matches[1].'&autoplay=0" type="application/x-shockwave-flash" wmode="transparent" width="700" height="400" />'.
               '</object>';
The variable '.$matches[1].' in the embed value will return the video ID. If your video site uses multiple IDs in the url I suggest you check out the metacafe code to see how that works.

Step 4
You should check to see if the video site supports WWW and non-WWW urls. If it supports both you will need to copy/paste the code you just created and add/subtract the WWW so that it will recognize both versions of the site.

Now Available: Facebook Connect Module !

Last edited by Yankidank; 04-08-2009 at 10:29 AM.
Reply With Quote
  #3 (permalink)  
Old 04-03-2009, 01:35 PM
Constant Pligger
Pligg Version: 1
 
Join Date: Feb 2009
Posts: 104
Installed like a charm .... !

Excellent module!
Reply With Quote
  #4 (permalink)  
Old 04-03-2009, 02:12 PM
Dionysus's Avatar
Casual Pligger
Pligg Version: 1.0.2
 
Join Date: Jun 2007
Posts: 61
Installed, and thumbnail comes out..

It pop-ups, but no video is played, just a black screen.

http://www.koreantopnews.com/index.php?category=Korean-Food
Reply With Quote
  #5 (permalink)  
Old 04-03-2009, 02:37 PM
Constant Pligger
Pligg Version: 1
 
Join Date: Feb 2009
Posts: 104
True doesnt work in your site Dionysus...

Also I would like to ask the author of the module or anyone who knows! If I have a video file , is it possible to display it in my website in a similar fashion like this module works?using jquery and the video module? I want to make a video tour of my pligg site. Hence have a link that will pop up showing the video/movie file stored on the server.

If anyone can suggest maybe another method is welcomed...maybe it can be done with javascript and flash also ??

In more amature way maybe upload the video in youtube and link the youtube url to my site and hence use the video module:P

thanks in advance,
cheers...
Reply With Quote
  #6 (permalink)  
Old 04-03-2009, 02:39 PM
New Pligger
 
Join Date: Feb 2009
Posts: 23
Many thanks Yankydank, it's a great mod. Just one thing I noticed....with IE8 I can't close the pop-up...with FF it works.
Reply With Quote
  #7 (permalink)  
Old 04-03-2009, 05:10 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,803
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Updating it again today. I have 3 new sites supported:
  • cbsnews.com
  • cnn.com
  • jumpcut.com
-------------------------------------

Quote:
Originally Posted by Dionysus View Post
Installed, and thumbnail comes out..
It pop-ups, but no video is played, just a black screen.
http://www.koreantopnews.com/index.php?category=Korean-Food
It looks like you customized the module because it's showing both a youtube thumbnail (on the right) and a default image (on the left). I can't support you if you are making any changes to it because chances are that you broke it and it's not a problem caused by the default settings.
I tested an identical url that you use on your site and it worked fine for me. Could be a template difference, server specifications, or just modifications made to the module. From what I see it looks like the problem is that the module isn't detecting your submitted urls correctly so it doesn't know what code to embed.

Quote:
Originally Posted by plafon View Post
Also I would like to ask the author of the module or anyone who knows! If I have a video file , is it possible to display it in my website in a similar fashion like this module works?using jquery and the video module? I want to make a video tour of my pligg site. Hence have a link that will pop up showing the video/movie file stored on the server.

If anyone can suggest maybe another method is welcomed...maybe it can be done with javascript and flash also ??

In more amature way maybe upload the video in youtube and link the youtube url to my site and hence use the video module:P
You would need to set up a flash player on your site and then use the Fancybox effect to display it. You will need to edit some template files for your site's theme, not the Video Plus module. As an example you can look at the source for pliggmods.com. I embedded a login form that is activated from the login link at the top right corner of the site. This is all documented on the Fancybox google code page.


Quote:
Originally Posted by MORGARTEN View Post
Many thanks Yankydank, it's a great mod. Just one thing I noticed....with IE8 I can't close the pop-up...with FF it works.
I only have IE7, which it works perfectly on. Sorry, but I can't support IE8 right now because I refuse to upgrade to it. Maybe someone else could confirm or help us fix the problem. It would have something to do with the jQuery Fancybox effect.

Now Available: Facebook Connect Module !
Reply With Quote
  #8 (permalink)  
Old 04-03-2009, 05:47 PM
Dionysus's Avatar
Casual Pligger
Pligg Version: 1.0.2
 
Join Date: Jun 2007
Posts: 61
Quote:
Originally Posted by Yankidank View Post
It looks like you customized the module because it's showing both a youtube thumbnail (on the right) and a default image (on the left). I can't support you if you are making any changes to it because chances are that you broke it and it's not a problem caused by the default settings.
I tested an identical url that you use on your site and it worked fine for me. Could be a template difference, server specifications, or just modifications made to the module. From what I see it looks like the problem is that the module isn't detecting your submitted urls correctly so it doesn't know what code to embed.
I haven't modified the module. It's an rss import feed
Reply With Quote
  #9 (permalink)  
Old 04-03-2009, 06:22 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,803
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
I just ran a Youtube RSS import feed from YouTube - Broadcast Yourself..

Works perfectly for me. It might be the feed that you are using that is screwing it up.

Now Available: Facebook Connect Module !
Reply With Quote
  #10 (permalink)  
Old 04-03-2009, 06:40 PM
jerrytheman's Avatar
Casual Pligger
Pligg Template: custom
 
Join Date: Dec 2008
Posts: 32
looks good
Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
iPhone/iPod Touch RSS Reader For Sale nzbullet Questions and Comments 15 08-26-2009 09:35 AM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development