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

Runtime File Attribute Value


How to fetch url of video from MYSQL for file attribute value?
'file': '<?php echo $row['url']; } ?>'
i try above code but it not work.

1 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi there,

Are you able to assign the output from your PHP call to a JavaScript variable? If so, you should be able to then pass that to the file player configuration option.

var videoFile = <?php echo json_encode($row['url']); ?>;

playerInstance.setup({
  file: videoFile
});

Note that I am encoding the PHP output as JSON in order to make sure it’s formatted properly for use in JavaScript.

Thank you.

This question has received the maximum number of answers.