Skip to content
Media CloudDocs
Video Encoding Filters and Actions
On this page

Video Encoding Filters and Actions

Filters

1 min read·6 tags

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);
});

Need a hand with this guide?

Send support the exact step you’re stuck on and we’ll help you finish the setup.

Contact support
Start typing to search the docs

Escto close·⌘Kto open

View all results →