1
votes

i have some issues when playing youtube videos on my site using jwplayer7.

https://support.jwplayer.com/customer/portal/articles/1406725-youtube-video-embed

from this tutorial, i have trying to do like this. my player appear but the videos wont work, just loading and loading.

This is my code :

<script src="jwplayer/jwplayer.js" ></script>
<script>jwplayer.key="MY SECRET KEY";</script>

<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "//www.youtube.com/watch?v=H7HmzwI67ec",
width: 640,
height: 360
});
</script>

i am sure i have following the tutorial clearly. but why it still not working? PLease i need anyones help.

Here the screenshot

1

1 Answers

1
votes

Hi your player seems to work fine in jsfiddle it might have something to do with your .js file or key See code here

<script src="jwplayer/jwplayer.js" ></script>
<script>jwplayer.key="MY SECRET KEY";</script>

<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "//www.youtube.com/watch?v=H7HmzwI67ec",
width: "100%",
});
</script>