I'm currently facing an issue with JW Player and I was hoping someone here could help me out. I'm trying to pass data from PHP to the JW Player using a variable, but it doesn't seem to be working.
Here's a bit of background on my setup: I have a PHP script that retrieves the necessary data from a database and stores it in a variable called `$videoData`. This variable contains the required attributes like the video URL, title, and other metadata.
Now, when I try to pass this data to JW Player, the player doesn't seem to recognize it. I've checked that the `$videoData` variable is indeed populated correctly by printing it out, so there shouldn't be any issues there.
Here's a simplified version of my code:
var player = jwplayer('player-div');
file: <?php echo json_encode($videoData['video_url']); ?>,
title: <?php echo json_encode($videoData['title']); ?>
// other configuration options...
As mentioned before, the `echo` statements do output the correct values when I check the page source, so I'm not sure why the JW Player doesn't seem to recognize them.
I've also tried hardcoding the values directly into the `file` and `title` properties, and the player works perfectly. It only seems to be an issue when I try to pass the data through the PHP variable.
I have a feeling that I might be missing something very basic here, so any help or guidance would be greatly appreciated. Is there anything specific I should be aware of when passing data from PHP to JW Player? Am I doing something wrong in my code?
Thanks in advance for your assistance!