Embed GoogleVideo


This is a simple plugin that enables you to embed a GoogleVideo video into a wiki page.

Usage

When you view a video at GoogleVideo there is a small box to the right of the video titled 'About this video'. There is a text box labeled URL that contains the URL you can use to share the video with others. NOTE: this plugin uses this URL as it's input - not the URL included in the object/embed tag.

{{googlevideo url="http://video.google.com/videoplay?docid=XXXXXXXXXXXXXXXXXXX" [width="425" height="350" bgcolor="#ffffff"]}}



Install

Add googlevideo.php to the actions folder of your Wikka install.

Code

googlevideo.php (line 1)
  1. <?php
  2. /*
  3. GoogleVideo plugin created by Mariano Pardo; http://www.lossimpsonsonline.com.ar
  4.  
  5. USE: {{googlevideo url="http://video.google.com/videoplay?docid=XXXXXXXXXXXXXXXXXXX" [width="425" height="350" bgcolor="#ffffff"]}}
  6.  
  7. 'url' must be provided, and is the URL specified in the 'About this video' section next to the video.
  8. 'width', 'height' and 'bgcolor' are all optional.  Defaults are listed above.
  9. */
  10.  
  11. if (!($url)) {
  12.     print "<strong>You must provide the GoogleVideo url, including 'http://'.</strong>";
  13.     return;
  14. } else {
  15.     if (!$width)
  16.         $width = 425;
  17.     if (!$height)
  18.         $height = 350;
  19.     if (!$bgcolor)
  20.         $bgcolor = "#ffffff";
  21. }
  22.  
  23. // http://video.google.com/videoplay?docid=XXXXXXXXXXXXXXXXXXX - if URL in this format, need to change to /googleplayer.swf\?docId=XXXXXXXXXXXXXXXXXXX
  24. $ptn = "/videoplay\?docid=([A-Za-z0-9_\-]{19})$/";
  25.  
  26. print '<object type="application/x-shockwave-flash"
  27. data="http://video.google.com/googleplayer.swf?docId='.$id.'" width="'.$width.'"
  28. height="'.$height.'" id="VideoPlayback">
  29. <param name="movie" value="http://video.google.com/videoplay\?docid='.$id.'" />
  30. <param name="allowScriptAccess" value="sameDomain" />
  31. <param name="quality" value="best" />
  32. <param name="bgcolor" value="'.$bgcolor.'" />
  33. <param name="scale" value="noScale" />
  34. <param name="FlashVars" value="playerMode=embedded" />
  35. </object>';
  36. ?>


Created By

GoogleVideo plugin created by Mariano Pardo (marian2js); https://mpcapital.ai/

CategoryUserContributions
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki