<?php
declare( strict_types=1 );
defined( 'ABSPATH' ) || exit;

$attrs = $attributes;
global $ActiveAddons;

if( isset( $ActiveAddons['qiniukodo'] ) && is_object( $ActiveAddons['qiniukodo'] ) ){
    if( !isset($attrs['key']) ) return;
    $geturl = $ActiveAddons['qiniukodo']->call_url( $attrs['key'] );
    
    if( $geturl['status'] == '1' ){
        $attrs['source'] = $geturl['data'];
        unset( $attrs['key'] );
        $video_safe = do_blocks('<!-- wp:mine-cloudvod/dplayer '.json_encode($attrs).' /-->');
        
        echo $video_safe;
    }
}