Embed video from streamtape using direct link

Question

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 );
}
0
Ferreol 2 years 2020-10-21T16:10:19-05:00 0 Answers 76 views 1

Leave an answer

Browse
Browse