Try for free

Video Encoding Filters and Actions

Filters

media-cloud/video/videojs-enqueue-plugins

This filter allows you to enqueue any additional plugin javascript. The $lastDep parameter is the name of the last script dependency and any plugins should be enqueued as dependents of it. You must return the handle identifier for the last script you enqueue so that dependencies are managed properly.

add_filter('media-cloud/video/videojs-enqueue-plugins', function($lastDep) {
    wp_enqueue_script('my_videojs_plugin', get_stylesheet_directory_uri().'/js/your-videojs-plugin.js', [$lastDep], null, true);
    return 'my_videojs_plugin';
}, 10, 1);

media-cloud/video/videojs-player-settings

Allows you to add settings that are used to initialize the Video JS player.

add_filter('media-cloud/video/videojs-player-settings', function($playerSettings) {
    $playerSettings['plugins']['myplugin'] = ['whatever' => true];
    return $playerSettings;
});

Actions

media-cloud/video/videojs-enqueue-style

Register any additional CSS for the Video JS player.

add_action('media-cloud/video/videojs-enqueue-style', function() {
    wp_enqueue_style('my_videojs_css', get_stylesheet_directory_uri().'/css/my-videojs-player.css', ['mux_video_player_style'], null);
});