Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Filename: vipers-video-quicktags.php
- // In function shortcode_youtube()
- // Modified to use Youtube iframe for individual videos
- // Find this "Setup the parameters" in the funciton ...
- $rel = ( 1 == $atts['rel'] ) ? '1' : '0';
- $fs = ( 1 == $atts['fs'] ) ? '1' : '0';
- $showsearch = ( 1 == $atts['showsearch'] ) ? '1' : '0';
- $showinfo = ( 1 == $atts['showinfo'] ) ? '1' : '0';
- // ADDED
- $iframeurl = 'http://www.youtube.com/embed/' . $videoid . '?feature=oembed';
- foreach ( array( 'fs', 'rel', 'showsearch', 'showinfo' ) as $attribute ) {
- $iframeurl = add_query_arg( $attribute, $$attribute, $iframeurl );
- }
- $objectid = $this->videoid('youtube');
- // Hack until this plugin properly supports iframe-based embeds
- if ( ! empty( $iframe ) ) {
- return '<iframe class="vvqbox vvqyoutube" width="' . esc_attr( $atts['width'] ) . '" height="' . esc_attr( $atts['height'] ) . '" src="'. esc_url( $iframe . '&rel=' . $rel . '&fs=' . $fs . '&showsearch=' . $showsearch . '&showinfo=' . $showinfo . $autoplay . $loop . $hd ) . '" frameborder="0" allowfullscreen></iframe>';
- }
- $this->swfobjects[$objectid] = array(
- 'width' => $atts['width'],
- 'height' => $atts['height'],
- 'url' => 'http://www.youtube.com/' . $embedpath . $color1 . $color2 . $border . '&rel=' . $rel . '&fs=' . $fs . '&showsearch=' . $showsearch . '&showinfo=' . $showinfo . $autoplay . $loop . $hd,
- );
- // MODIFIED
- return '<span class="vvqbox vvqyoutube" style="width:' . $atts['width'] . 'px;"><span class="video-container"><iframe id="' . $objectid . '" src="' . esc_attr( $iframeurl ) . '" width="' . $atts['width'] . '" height="' . $atts['height'] . '" frameborder="0"><a href="' . $fallbacklink . '">' . $fallbackcontent . '</a></iframe></span></span>';
- }
Advertisement
Add Comment
Please, Sign In to add comment