below code play video in page using shortcode : [single_video]
how to make it play shuffle all the videos at that folder in a loop using short code that can pass folder name like : [shuffle_play_gallery folder="naturevideos"]
function display_single_video() {
$video_url = 'https://website.com/videos/test.mp4';
// Generate the video element
$video_element = '<video width="320" height="240" controls>
<source src="' . $video_url . '" type="video/mp4">
Your browser does not support the video tag.
</video>';
return $video_element;
}
// Register the shortcode to display the single video
add_shortcode('single_video', 'display_single_video');
any help appreciated and
thanks for help
The client (web browser) will need to know a list of available files. You can either:
Afterwards, it's a client-side task. I would do it like this:
ended
event (documentation)src
attribute on your <video>
element with the next URL.play()
on the element