Title: [Plugin: Vimeo Short Code] autoplay functionality
Last modified: August 20, 2016

---

# [Plugin: Vimeo Short Code] autoplay functionality

 *  [Giorgio M](https://wordpress.org/support/users/webjumbo/)
 * (@webjumbo)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/plugin-vimeo-short-code-autoplay-functionality/)
 * Hi,
 * first of all thanks for your work!
 * I’ve modified the plugin code to make videos’ autoplay possible .
 * This is the updated code:
 *     ```
       /*
       Plugin Name: Vimeo HTML5 shortcode
       Plugin URI: http://blog.esimplestudios.com/2010/08/embedding-vimeo-videos-on-wordpress
       Description: Allows the user to embed Vimeo movie clips by entering a shortcode ([vimeo]) into the post area.
       Author: Gabriele Maidecchi
       Version: 1.0
       Author URI: http://www.esimplestudios.com/
       License: GPL 2.0, @see http://www.gnu.org/licenses/gpl-2.0.html
   
       EDITED BY MAIDO 2010-08-18 to support new Vimeo HTML5-friendly embed code
   
       Full credits go to the original version of the plugin, below:
   
       Plugin Name: Lux Vimeo
       Plugin URI: http://www.partnervermittlung-ukraine.net/info/lux-vimeo-wordpress-plugin
       Description: Allows the user to embed Vimeo movie clips by entering a shortcode ([vimeo]) into the post area.
       Author: Matroschka
       Author URI: http://www.pastukhova-floeder.de/
       */
   
       class lux_vimeo {
           function shortcode($atts, $content=null) {
       		extract(shortcode_atts(array(
       			'clip_id' 	=> '',
       			'width' 	=> '400',
       			'height' 	=> '225',
       			'autoplay' 	=> '0',
       		), $atts));
   
       		if (empty($clip_id) || !is_numeric($clip_id)) return '<!-- Lux Vimeo: Invalid clip_id -->';
       		if ($height && !$width) $width = intval($height * 16 / 9);
       		if (!$height && $width) $height = intval($width * 9 / 16);
   
       		return "<iframe src='http://player.vimeo.com/video/$clip_id?title=0&byline=0&portrait=0&autoplay=$autoplay' width='$width' height='$height' frameborder='0'></iframe>";
           }
       }
   
       add_shortcode('vimeo', array('lux_vimeo', 'shortcode'));
       ```
   
 * thanks,
 * Giorgio
 * [http://wordpress.org/extend/plugins/lux-vimeo-shortcode/](http://wordpress.org/extend/plugins/lux-vimeo-shortcode/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [James](https://wordpress.org/support/users/jshake/)
 * (@jshake)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-vimeo-short-code-autoplay-functionality/#post-2535756)
 * Well done for getting this up and running Giorgio. I’ve taken what you’ve done
   and implemented it into the latest version of the plugin (1.1).
 * Here’s the code:
 *     ```
       <?php
       /*
       Plugin Name: Lux Vimeo
       Plugin URI: http://www.partnervermittlung-ukraine.net/info/lux-vimeo-wordpress-plugin
       Description: Allows the user to embed Vimeo movie clips by entering a shortcode ([vimeo]) into the post area.
       Author: Matroschka
       Version: 1.1
       Author URI: http://www.pastukhova-floeder.de/
       License: GPL 2.0, @see http://www.gnu.org/licenses/gpl-2.0.html
       */
   
       class lux_vimeo {
           function shortcode($atts, $content=null) {
       		extract(shortcode_atts(array(
       			'clip_id' 	=> '',
       			'width' 	=> '400',
       			'height' 	=> '225',
       			'title'	=> '1',
       			'byline'	=> '1',
       			'portrait'	=> '1',
       			'color'		=> '',
       			'html5' 	=> '1',
       			'autoplay' 	=> '0',
       		), $atts));
   
       		if (empty($clip_id) || !is_numeric($clip_id)) return '<!-- Lux Vimeo: Invalid clip_id -->';
       		if ($height && !$atts['width']) $width = intval($height * 16 / 9);
       		if (!$atts['height'] && $width) $height = intval($width * 9 / 16);
   
       		return $html5 ?
       			"<iframe src='http://player.vimeo.com/video/$clip_id?title=$title&byline=$byline&portrait=$portrait&autoplay=$autoplay' width='$width' height='$height' frameborder='0'></iframe>" :
       			"<object width='$width' height='$height'><param name='allowfullscreen' value='true' />".
           			"<param name='allowscriptaccess' value='always' />".
           			"<param name='movie' value='http://vimeo.com/moogaloop.swf?clip_id=$clip_id&server=vimeo.com&show_title=$title&show_byline=$byline&show_portrait=$portrait&color=$color&fullscreen=1&autoplay=$autoplay' />".
           			"<embed src='http://vimeo.com/moogaloop.swf?clip_id=$clip_id&server=vimeo.com&show_title=$title&show_byline=$byline&show_portrait=$portrait&color=$color&fullscreen=1' type='application/x-shockwave-flash' allowfullscreen='true' allowscriptaccess='always' width='$width' height='$height'></embed></object>".
           			"<br /><a href='http://vimeo.com/$clip_id'>View on Vimeo</a>.";
           }
       }
   
       add_shortcode('vimeo', array('lux_vimeo', 'shortcode'));
   
       ?>
       ```
   
 *  [smogdog](https://wordpress.org/support/users/smogdog/)
 * (@smogdog)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-vimeo-short-code-autoplay-functionality/#post-2535773)
 * Hi
    I’m using this plugin, simple and works like it’s meant to:-)
 * But I can’t get the color to display, I’ve added the short code color=”37ab88″
   but it still diplays the “vimeo blue”
 * Any help is appreciated
 * Cheers
 * Hans g

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘[Plugin: Vimeo Short Code] autoplay functionality’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/lux-vimeo-shortcode.svg)
 * [Vimeo Short Code](https://wordpress.org/plugins/lux-vimeo-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/lux-vimeo-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/lux-vimeo-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lux-vimeo-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lux-vimeo-shortcode/reviews/)

 * 2 replies
 * 3 participants
 * Last reply from: [smogdog](https://wordpress.org/support/users/smogdog/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/plugin-vimeo-short-code-autoplay-functionality/#post-2535773)
 * Status: not a support question