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

YouTube embed not working


I'm trying to embed a youtube video using self-hosted jwplayer (hosted in my own pc).
I'm following this tutorial https://support.jwplayer.com/customer/portal/articles/1406725-youtube-video-embed.
The player loads, but there's no preview image, when you try to play it, it never stops loading and when you stop it the following error appears: "Y is null". Firefox and Chrome same result.
Here's the code:

<!DOCTYPE html>
<html>
<head>
​<script src="jwplayer-7.5.0/jwplayer-7.5.0/jwplayer.js"></script>
<script>jwplayer.key="dVRGLx66IjktdMQDkDUP2pDGdROGig9o1k4C9A==";</script>
</head>
<body>
<div id="myElement"></div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "//www.youtube.com/watch?v=bKttENbsoyk",
width: 640,
height: 360
});
</script>
</body>
</html>

The path to jwplayer.js is okay, I checked.
I would really appreciate any hints on what might be the problem.

1 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi there,

YouTube has made some changes on their end that now requires at least the YouTube URLs to be secure (i.e. https://www.youtube.com/watch?v=bKttENbsoyk). I would recommend trying to specify the URL using the https protocol.

Also, currently poster images from YouTube are not coming through their API. Our Engineers are currently looking into why this is the case, but as a workaround, you can specify your own poster image by including a path to an image in the image configuration option in your setup.

Please let me know if you need any more help or have any other questions.

Thank you!

This question has received the maximum number of answers.