Software: Apache. PHP/5.5.15 uname -a: Windows NT SVR-DMZ 6.1 build 7600 (Windows Server 2008 R2 Enterprise Edition) i586 SYSTEM Safe-mode: OFF (not secure) C:\Intranet\C\xampp\htdocs\drupal\modules\lightbox2\js\ drwxrwxrwx |
Viewing file: lightbox_video.js (7.12 KB) -rw-rw-rw- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* $Id: lightbox_video.js,v 1.1.4.6 2008/06/20 13:56:52 snpower Exp $ */ /** * Lightbox video * @author * Stella Power, <http://drupal.org/user/66894> */ /** * Table of Contents * ----------------- * Lightvideo Class Declaration * - startVideo() * - createEmbed() * - checkKnownVideos() * * Video Provider Functions * - checkYouTubeVideo() * - checkGoogleVideo() * - checkMetacafeVideo() * - checkIFilmSpikeVideo() * - checkMySpaceVideo() * - checkLiveVideo() * */ var Lightvideo = { // startVideo() startVideo: function (href) { if (Lightvideo.checkKnownVideos(href)) { return; } else if (href.match(/\.mov/i)) { if (navigator.plugins && navigator.plugins.length) { Lightbox.modalHTML ='<object id="qtboxMovie" type="video/quicktime" codebase="http://www.apple.com/qtactivex/qtplugin.cab" data="'+href+'" width="'+Lightbox.modalWidth+'" height="'+Lightbox.modalHeight+'"><param name="src" value="'+href+'" /><param name="scale" value="aspect" /><param name="controller" value="true" /><param name="autoplay" value="true" /><param name="bgcolor" value="#000000" /><param name="enablejavascript" value="true" /></object>'; } else { Lightbox.modalHTML = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="'+Lightbox.modalWidth+'" height="'+Lightbox.modalHeight+'" id="qtboxMovie"><param name="src" value="'+href+'" /><param name="scale" value="aspect" /><param name="controller" value="true" /><param name="autoplay" value="true" /><param name="bgcolor" value="#000000" /><param name="enablejavascript" value="true" /></object>'; } } else if (href.match(/\.wmv/i) || href.match(/\.asx/i)) { Lightbox.modalHTML = '<object NAME="Player" WIDTH="'+Lightbox.modalWidth+'" HEIGHT="'+Lightbox.modalHeight+'" align="left" hspace="0" type="application/x-oleobject" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"><param NAME="URL" VALUE="'+href+'"><param><param NAME="AUTOSTART" VALUE="false"></param><param name="showControls" value="true"></param><embed WIDTH="'+Lightbox.modalWidth+'" HEIGHT="'+Lightbox.modalHeight+'" align="left" hspace="0" SRC="'+href+'" TYPE="application/x-oleobject" AUTOSTART="false"></embed></object>'; } else { Lightbox.videoId = href; Lightvideo.createEmbed(href, "flvvideo", "#ffffff"); } }, // createEmbed() createEmbed: function(href, id, color, variables) { var bgcolor = 'bgcolor="' + color + '"'; var flashvars = ""; if (variables) { flashvars = variables; } Lightbox.modalHTML = '<embed type="application/x-shockwave-flash" ' + 'src="' + href + '" ' + 'id="' + id + '" name="' + id + '" ' + bgcolor + ' ' + 'quality="high" wmode="transparent" ' + flashvars + ' ' + 'height="' + Lightbox.modalHeight + '" ' + 'width="' + Lightbox.modalWidth + ' ' + '">'; }, // checkKnownVideos() checkKnownVideos: function(href) { if (Lightvideo.checkYouTubeVideo(href) || Lightvideo.checkGoogleVideo(href) || Lightvideo.checkMySpaceVideo(href) || Lightvideo.checkLiveVideo(href) || Lightvideo.checkMetacafeVideo(href) || Lightvideo.checkIFilmSpikeVideo(href) ) { return true; } return false; }, // checkYouTubeVideo() checkYouTubeVideo: function(href) { var patterns = [ 'youtube.com/v/([^"&]+)', 'youtube.com/watch\\?v=([^"&]+)', 'youtube.com/\\?v=([^"&]+)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.youtube.com/v/"+Lightbox.videoId, "flvvideo", "#ffffff"); return true; } } return false; }, // checkGoogleVideo() checkGoogleVideo: function(href) { var patterns = [ 'http://video.google.[a-z]{2,4}/googleplayer.swf\\?docId=(-?\\d*)', 'http://video.google.[a-z]{2,4}/videoplay\\?docid=([^&]*)&', 'http://video.google.[a-z]{2,4}/videoplay\\?docid=(.*)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://video.google.com/googleplayer.swf?docId="+Lightbox.videoId+"&hl=en", "flvvideo", "#ffffff"); return true; } } return false; }, // checkMetacafeVideo() checkMetacafeVideo: function(href) { var patterns = [ 'metacafe.com/watch/(\.[^/]*)/(\.[^/]*)/', 'metacafe.com/watch/(\.[^/]*)/(\.*)', 'metacafe.com/fplayer/(\.[^/]*)/(\.[^.]*).' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.metacafe.com/fplayer/"+Lightbox.videoId+"/.swf", "flvvideo", "#ffffff"); return true; } } return false; }, // checkIFilmSpikeVideo() checkIFilmSpikeVideo: function(href) { var patterns = [ 'spike.com/video/[^/&"]*?/(\\d+)', 'ifilm.com/video/[^/&"]*?/(\\d+)', 'spike.com/video/([^/&"]*)', 'ifilm.com/video/([^/&"]*)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.spike.com/efp", "flvvideo", "#000", "flashvars=\"flvbaseclip="+Lightbox.videoId+"&\""); return true; } } return false; }, // checkMySpaceVideo() checkMySpaceVideo: function(href) { var patterns = [ 'src="myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)', 'myspace.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)', 'src="myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)"', 'myspacetv.com/index.cfm\\?fuseaction=vids.individual&videoid=([^&"]+)' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://lads.myspace.com/videos/vplayer.swf", "flvvideo", "#ffffff", "flashvars=\"m="+Lightbox.videoId+"\""); return true; } } return false; }, // checkLiveVideo() checkLiveVideo: function(href) { var patterns = [ 'livevideo.com/flvplayer/embed/([^"]*)"', 'livevideo.com/video/[^/]*?/([^/]*)/', 'livevideo.com/video/([^/]*)/' ]; for (var i = 0; i < patterns.length; i++) { var pattern = new RegExp(patterns[i], "i"); var results = pattern.exec(href); if (results !== null) { Lightbox.videoId = results[1]; Lightvideo.createEmbed("http://www.livevideo.com/flvplayer/embed/"+Lightbox.videoId, "flvvideo", "#ffffff"); return true; } } return false; } }; |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #13 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0312 ]-- |