googlevideo_shortcode

Google video is replaced by youtube, but its embeds will probably continue working indefinitely.

Description

googlevideo_shortcode( $atts ); 

[googlevideo=http://video.google.com/googleplayer.swf?docId=-6006084025483872237]

Parameters (1)

0. $atts
The atts.

Usage

  1. if ( !function_exists( 'googlevideo_shortcode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'jetpack-by-wordpress-com/modules/shortcodes/googlevideo.php'; 
  3.  
  4. // The atts. 
  5. $atts = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = googlevideo_shortcode($atts); 
  9.  

Defined (1)

The function is defined in the following location(s).

/modules/shortcodes/googlevideo.php  
  1. function googlevideo_shortcode( $atts ) { 
  2. if ( !isset( $atts[0] ) ) 
  3. return ''; 
  4.  
  5. $src = ltrim( $atts[0], '=' ); 
  6.  
  7. if ( 0 !== strpos( $src, 'http://video.google.com/googleplayer.swf' ) ) { 
  8. if ( !preg_match( '|^http://(video\.google\.[a-z]{2, 3}(?:.[a-z]{2})?)/|', $src ) || !preg_match( '|.*docid=([0-9-]+).*|i', $src, $match ) || !is_numeric( $match[1] ) ) 
  9. return '<!--Google Video Error: bad URL entered-->'; 
  10.  
  11. $src = 'http://video.google.com/googleplayer.swf?docId=' . $match[1]; 
  12.  
  13. // default width should be 400 unless the theme's content width is smaller than that 
  14. global $content_width; 
  15. $default_width = intval( !empty( $content_width ) ? min( $content_width, 400 ) : 400 ); 
  16. $height = intval( 0.825 * $default_width ); 
  17. $src = esc_attr( $src ); 
  18.  
  19. return "<span style='text-align:center;display:block;'><object width='{$default_width}' height='{$height}' type='application/x-shockwave-flash' data='{$src}'><param name='allowScriptAccess' value='never' /><param name='movie' value='$src'/><param name='quality' value='best'/><param name='bgcolor' value='#ffffff' /><param name='scale' value='noScale' /><param name='wmode' value='opaque' /></object></span>";