Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Jw player .mp4 video shuffle rotate help

I am using jw player on my site and I would like to know what is the correct way to play random .mp4 video files when you press the play button I have included the code that i am using on my site to play just one .mp4 file, I have a folder with several .mp4 video files that I would like to randomly play on the press of the play button when a user visits my page.

my folder has videos labeled hdvideo1.mp4,hdvideo2.mp4 etc....

$(".vid-play-img").click(function() {
$( "#daOverlay" ).show();
logo: false,
file: '/hdvideo4.mp4',
image: "{{ $title->background }}",
width: "100%",
aspectratio: "16:9",
autostart: true,
controls: false

1 Community Answers


JW Player Support Agent  
0 rated :

I’d probably add all the video paths to an array and then use something like this to pick a random entry and set it as the file
function getRandomArbitrary(min, max) {
return Math.random() * (max – min) + min;

This question has received the maximum number of answers.