'PHP loading JS video player
So I have this PHP script to show my videos in Fluid Player, it looks like this:
while($video = mysqli_fetch_array($resultat_video, MYSQLI_ASSOC))
{
echo "<video id='video-id'><source src='mov/$video[filnavn]' type='video/mp4' />";
}
Loading the Javascript to load Fluid players looks like this:
<script>
var myFP = fluidPlayer(
'video-id', {
"layoutControls": {
"controlBar": {
"autoHideTimeout": 3,
"animated": true,
"autoHide": true
},
"htmlOnPauseBlock": {
"html": null,
"height": null,
"width": null
},
"autoPlay": false,
"mute": true,
"allowTheatre": true,
"playPauseAnimation": false,
"playbackRateEnabled": false,
"allowDownload": false,
"playButtonShowing": false,
"fillToContainer": false,
"posterImage": ""
},
"vastOptions": {
"adList": [],
"adCTAText": false,
"adCTATextPosition": ""
}
});
</script>
This works perfectly for one video, but i guess I can't call the same ID in my PHP ID and expet it to work, so I guess it needs some sort of invidual ID both in the PHP and also in the Javascript?
I'm very new to Javascript so all help is apprichiated alot :)
Regards, Jan
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
