Video Onclick

Most online video players have heavy code, which slows page load. My Plugin adds only picture of the player, after a user clicks on it, the player code is loaded.


Youtube example

Vimeo Example

Also this plugin adds YouTube and Vimeo button to the MCE, that pasts youtube shortcode in the post.


1. Upload ‘/video-onclick/’ to the ‘/wp-content/plugins/’ directory
2. Activate the plugin through the ‘Plugins’ menu in WordPress
3. Add in post or page shortcode

Video container structure



CSS Example

This CSS is used on my site

Version History


  • NEW: Option to disable pop-up video
  • FIX: Fatal error while activation in 0.4.5 version


  • NEW: Added pagination to errors table
  • FIX: Error with getting ID of the posts with errors
  • FIX: Adding error videos to cache


  • NEW: Vimeo shortcode now provide Thumbnail, New Popup window with CSS support, Error reporting


  • NEW: Table in options, that shows youtube videos that had error for last 72 hours and in which post.
  • NEW: Default CSS file. Can be switched off in options.


  • NEW: Design of the thumbnail in text
  • NEW: Title is loaded from Youtube or can be entered in shortcode attribute title=””
  • NEW: Play button in the center of the image. It can be configured in options, or in shortcode attribute play_img=””


  • FIX: Error when youtube video does not exist


  • NEW: Thumbnails for youtube videos are parsed from youtube and cached.
  • NEW: New popup windows structure with DIVs and CSS
  • NEW: Special DIV that can be configured to show certain HTML code
  • NEW: Option to change and design Closing button


NEW: Vimeo support
NEW: Vimeo shortcode


NEW: Google Analytics async tracking code


NEW: MCE button

NEW: youtube shortcode

Known Issues

If page contains several videos with same id, then video will be played on earliest picture.

Неправильная раскладка: мшвущ щтсдшсл

Понравилась статья? Посоветуйте друзьям!

PHP WordPress WordPress Plugin Youtube

Понравилась статья? Подпишись на рассылку по E-Mail или в RSS.
  • Hans Andersen
    Hi i love your youtube onclick plugin. It just made my day. Only thing, is there a way to make the player smaller, so it\'s a third of the present size? I am very new to css and coding in general. I tried to change in width and height variables in the css file but couldn\'t make it work. If you could list code or in other ways help to make the player smaller, like to half or one third of the size, that d be awesome. Thanks for any help on this. Hans andersen
  • Do you mean size of the div or youtube player itself. First is changed through CSS. Second is hardcoded in video-onclick.js, You can change it there, but first read about allowed sizes
  • anudeep Sunka
    Is it enough if we just activate
  • Use youtube or vimeo shortcode []