Embed video from streamtape using direct link

Good Afternoon, i want to embed this video in my wordpress https://streamtape.com/v/7qDqGjlQe4UA9MR/Soul_Land_03_VOSTFR.mp4 Embed code iframe src=https://streamtape.com/e/7qDqGjlQe4UA9MR/Soul_Land_03_VOSTFR.mp4 width=800 height=600 allowfullscreen allowtransparency allow=autoplay scrolling=no frameborder=0/iframe

I have tried to paste the following code in my theme function.php file but it doesn't function. I would be very happy to receive your help

add_action( 'init', function()
{        wp_embed_register_handler(
        'streamtape', 
        '#https://streamtape\.com\/v\/([a-zA-Z0-9_-]+)$#i',   
        'streamtape_embed_handler' 
    );
} );


function streamtape_embed_handler( $matches, $attr, $url, $rawattr )
{
    $embed = sprintf( 
        'IFRAME SRC=https://streamtape.com/e/([a-zA-Z0-9_-]+)$#i FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=800 HEIGHT=600 allowfullscreen/IFRAME',
        esc_attr( $matches[1] )
    );
    return apply_filters( 'streamtape_embed_handler', $embed, $matches, $attr, $url, $rawattr );
}

Topic embed functions oembed videos php Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.