Video not playing, Youtube error
-
Hi, I have an ACF field to paste a Youtube video which is then displayed on a page. No thumbnail is displayed and when hovering the video, the play button becomes red (https://ibb.co/cbKbqHW). Once I click the video, a Youtube error “Please click here to watch this video on YouTube.” is displayed (https://ibb.co/CWqkLQb)
After clicking the play button, the following error appears in the console https://ibb.co/ScGTSF0
- Youtube API key seems fine and working.
- ACF field is delivering a Youtube ID
What I would like to see?
-> The video to be loaded and play as well as a thumbnail being displayed, so that the video only loads after a click on the thumbnail.How could I make it work?
The code to display the videos:
<?php $video = get_field( "youtube_video" ); $featured_img = wp_get_attachment_url( get_post_thumbnail_id($post->ID), 'thumbnail' ); if( get_field('youtube_video') ) { if ( function_exists('lyte_preparse') ) { echo lyte_preparse($video); } } else { echo '<img src="'.$featured_img.'" alt="VECUB AG">'; } ?>
Thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Video not playing, Youtube error’ is closed to new replies.