diff options
author | Heckyel <heckyel@openmailbox.org> | 2017-02-07 22:05:21 -0500 |
---|---|---|
committer | Heckyel <heckyel@openmailbox.org> | 2017-02-07 22:05:21 -0500 |
commit | 76114ab808d6d1c1366daf11172dd19ced8053a6 (patch) | |
tree | 67bfb1455298b1e709ad72b4a5c7f55d094fc9d3 | |
parent | 47e42d8c3aab5bef3ca6b1107613d42695b48a13 (diff) | |
download | librevideojs-html5-player-76114ab808d6d1c1366daf11172dd19ced8053a6.tar.lz librevideojs-html5-player-76114ab808d6d1c1366daf11172dd19ced8053a6.tar.xz librevideojs-html5-player-76114ab808d6d1c1366daf11172dd19ced8053a6.zip |
new smart shortcode
-rw-r--r-- | librevideojs-html5-player.php | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/librevideojs-html5-player.php b/librevideojs-html5-player.php index e602525..c012125 100644 --- a/librevideojs-html5-player.php +++ b/librevideojs-html5-player.php @@ -23,7 +23,7 @@ if (!class_exists('LIBREVIDEOJS_HTML5_PLAYER')) { var $plugin_version = '1.1.2'; function __construct() { - define('LIBREVIDEOJS_HTML5_PLAYER_VERSION', $this->plugin_version); + define('L_VERSION', $this->plugin_version); $this->plugin_includes(); } @@ -84,21 +84,23 @@ if (!class_exists('LIBREVIDEOJS_HTML5_PLAYER')) { function librevideojs_html5_player_enqueue_scripts() { global $post; - if (is_home() || strpos($post->post_content, '[librevideojs_video') !== false){ - $plugin_url = plugins_url('', __FILE__); - wp_register_script('librevideojs', $plugin_url . '/librevideojs/js/cliplibrejs.dev.js', array(), LIBREVIDEOJS_HTML5_PLAYER_VERSION); - wp_enqueue_script('librevideojs'); - wp_register_style('librevideojs-mix-master-style', $plugin_url . '/librevideojs/css/mix-material/master.css', array(), '1.4'); - wp_enqueue_style('librevideojs-mix-master-style'); - wp_register_style('librevideojs-material-style', $plugin_url . '/librevideojs/css/librevideojs-material/master.css', array(), '1.4'); - wp_enqueue_style('librevideojs-material-style'); - wp_register_script('librevideojs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.js', array(), LIBREVIDEOJS_HTML5_PLAYER_VERSION); - wp_enqueue_script('librevideojs-selector'); - wp_register_style('librevideojs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.css', array(), '1.4'); - wp_enqueue_style('librevideojs-selector'); - } else{ - return false; - } + if (is_home() || is_single() && strpos($post->post_content, '[librevideojs_video') !== false){ + $plugin_url = plugins_url('', __FILE__); + wp_enqueue_style('lvjs-mix-master', $plugin_url . '/librevideojs/css/mix-material/master.css', array(), '1.4'); + wp_enqueue_style('lvjs-material', $plugin_url . '/librevideojs/css/librevideojs-material/master.css', array(), '1.4'); + wp_enqueue_style('lvjs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.css', array(), '1.4'); + wp_enqueue_script('lvjs', $plugin_url . '/librevideojs/js/cliplibrejs.dev.js', array(), L_VERSION); + wp_enqueue_script('lvjs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.js', array(), L_VERSION); + } else if (is_page() && strpos($post->post_content, '[librevideojs_video') !== false){ + $plugin_url = plugins_url('', __FILE__); + wp_enqueue_style('lvjs-mix-master', $plugin_url . '/librevideojs/css/mix-material/master.css', array(), '1.4'); + wp_enqueue_style('lvjs-material', $plugin_url . '/librevideojs/css/librevideojs-material/master.css', array(), '1.4'); + wp_enqueue_style('lvjs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.css', array(), '1.4'); + wp_enqueue_script('lvjs', $plugin_url . '/librevideojs/js/cliplibrejs.dev.js', array(), L_VERSION); + wp_enqueue_script('lvjs-selector', $plugin_url . '/librevideojs/selector/video-quality-selector.js', array(), L_VERSION); + } else { + return false; + } } function librevideojs_html5_video_embed_handler($atts, $content=null) { |