diff --git a/functions.php b/functions.php index 2d5305b..5aceb6d 100644 --- a/functions.php +++ b/functions.php @@ -56,6 +56,7 @@ function register_shortcodes(){ add_shortcode('sponsors', 'sponsors_shortcode'); add_shortcode('partners', 'partners_shortcode'); add_shortcode('transport', 'transport_shortcode'); + add_shortcode('stream-player', 'stream_player_shortcode'); } add_action( 'init', 'register_shortcodes'); @@ -203,6 +204,30 @@ function transport_shortcode() { } +function stream_player_shortcode($params = []) { + wp_enqueue_style('video.js', 'https://unpkg.com/video.js/dist/video-js.css'); + wp_enqueue_script('video.js', 'https://unpkg.com/video.js/dist/video.min.js'); + + $params = [ + 'host' => 'stream.openfest.org', + 'track' => 'hall-a', + ...$params, + ]; + + $urlPrefix = 'https://' . $params['host'] . '/'; + + ob_start(); +?> + +