Video.js - HTML5 Video Player for WordPress
[resolved] Only load CSS and JS files when needed? (3 posts)

  1. Chris
    Posted 3 years ago #

    Thanks for this great plugin! I haven't run into any issues, I just have a feature request:

    Could you make it so that the CSS file, JS file, and inline CSS only gets loaded on posts/pages that have the [video] or [videojs] shortcodes?

    Also, they just updated to 4.1.0 last week:

    It would be nice if the Video.js folks provided a URL that always pointed to the latest CSS and JS files. That way the CDN hosted version would always be up to date, and wouldn't require a plugin update.

    Thanks again!


  2. Dustin Lammiman
    Plugin Author

    Posted 2 years ago #

    The new version should do this in WordPress 3.6+ using the new has_shortcode() - see https://github.com/zencoder/video-js-for-wordpress/issues/3

    I will also update to 4.2. While it might make some sense to always point to the newest version on the CDN, there is also the risk that it might break some things. I noticed when making changes to the plugin from using 4.0 to 4.2 that I did have to tweak some of the plugin specific CSS. Better to know that an update is made so that you can check for bugs than to have it automatic and not know of potential issues.

  3. Chris
    Posted 2 years ago #

    Cool! Looking forward to the update.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Video.js - HTML5 Video Player for WordPress
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.