200 | | * The Google Video embed handler callback. |
201 | | * |
202 | | * Google Video does not support oEmbed. |
203 | | * |
204 | | * @see WP_Embed::register_handler() |
205 | | * @see WP_Embed::shortcode() |
206 | | * |
207 | | * @param array $matches The RegEx matches from the provided regex when calling wp_embed_register_handler(). |
208 | | * @param array $attr Embed attributes. |
209 | | * @param string $url The original URL that was matched by the regex. |
210 | | * @param array $rawattr The original unmodified attributes. |
211 | | * @return string The embed HTML. |
212 | | */ |
213 | | function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) { |
214 | | // If the user supplied a fixed width AND height, use it |
215 | | if ( !empty($rawattr['width']) && !empty($rawattr['height']) ) { |
216 | | $width = (int) $rawattr['width']; |
217 | | $height = (int) $rawattr['height']; |
218 | | } else { |
219 | | list( $width, $height ) = wp_expand_dimensions( 425, 344, $attr['width'], $attr['height'] ); |
220 | | } |
221 | | |
222 | | /** |
223 | | * Filters the Google Video embed output. |
224 | | * |
225 | | * @since 2.9.0 |
226 | | * |
227 | | * @param string $html Google Video HTML embed markup. |
228 | | * @param array $matches The RegEx matches from the provided regex. |
229 | | * @param array $attr An array of embed attributes. |
230 | | * @param string $url The original URL that was matched by the regex. |
231 | | * @param array $rawattr The original unmodified attributes. |
232 | | */ |
233 | | return apply_filters( 'embed_googlevideo', '<embed type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docid=' . esc_attr($matches[2]) . '&hl=en&fs=true" style="width:' . esc_attr($width) . 'px;height:' . esc_attr($height) . 'px" allowFullScreen="true" allowScriptAccess="always" />', $matches, $attr, $url, $rawattr ); |
234 | | } |
235 | | |
236 | | /** |