diff --git a/classes/Tools/ToolsManager.php b/classes/Tools/ToolsManager.php index 99f1c08e..06c2e9c7 100644 --- a/classes/Tools/ToolsManager.php +++ b/classes/Tools/ToolsManager.php @@ -336,6 +336,7 @@ public static function Boot() ToolsManager::registerTool( "storage", include ILAB_CONFIG_DIR . '/storage.config.php' ); ToolsManager::registerTool( "imgix", include ILAB_CONFIG_DIR . '/imgix.config.php' ); ToolsManager::registerTool( "video-encoding", include ILAB_CONFIG_DIR . '/video-encoding.config.php' ); + ToolsManager::registerTool( "video-player", include ILAB_CONFIG_DIR . '/video-player.config.php' ); ToolsManager::registerTool( "vision", include ILAB_CONFIG_DIR . '/vision.config.php' ); ToolsManager::registerTool( "crop", include ILAB_CONFIG_DIR . '/crop.config.php' ); ToolsManager::registerTool( "debugging", include ILAB_CONFIG_DIR . '/debugging.config.php' ); diff --git a/classes/Tools/Video/Driver/Mux/MuxHooks.php b/classes/Tools/Video/Driver/Mux/MuxHooks.php index 4c8087f8..9656cd67 100644 --- a/classes/Tools/Video/Driver/Mux/MuxHooks.php +++ b/classes/Tools/Video/Driver/Mux/MuxHooks.php @@ -60,12 +60,6 @@ public function __construct() } add_filter( 'template_include', [ $this, 'handleWebhook' ] ); - add_filter( - 'render_block', - [ $this, 'filterBlocks' ], - PHP_INT_MAX - 1, - 2 - ); } //endregion @@ -717,54 +711,5 @@ public function handleUpload( $attachmentId, $file, $meta ) { $this->handleDirectUpload( $attachmentId, $meta ); } - - //endregion - //region Content Filters - /** - * Filters the File block to include the goddamn attachment ID - * - * @param $block_content - * @param $block - * - * @return mixed - * @throws \Exception - */ - function filterBlocks( $block_content, $block ) - { - if ( isset( $block['blockName'] ) ) { - if ( $block['blockName'] === 'media-cloud/mux-video-block' ) { - return $this->filterVideoBlock( $block_content, $block ); - } - } - return $block_content; - } - - protected function filterVideoBlock( $block_content, $block ) - { - $muxId = arrayPath( $block, 'attrs/muxId', null ); - $asset = MuxAsset::asset( $muxId ); - - if ( $asset !== null ) { - $classes = "mux-player"; - $extras = ""; - $metadata = []; - $metadataKey = sanitize_title( gen_uuid( 12 ) ); - if ( !empty($this->settings->playerCSSClasses) ) { - $classes .= " {$this->settings->playerCSSClasses}"; - } - $block_content = str_replace( '