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

Uncaught TypeError: playerInstance.on is not a function


I'm trying to embed video and it's working, but "on" function doesn't work. It's showing me this error: Uncaught TypeError: playerInstance.on is not a function

My code is just before </body> tag

<script type="text/javascript"> var path_to_video, path_to_image;
path_to_video="http://cms.born2invest.com/uploads/video/2015/09/16/7161.mp4";
path_to_image="http://cms.born2invest.com/uploads/image/2015/09/16/7161.jpg";
path_to_video="http://cms.born2invest.com/uploads/video/video.mp4";
path_to_image="http://worldsoccertalk.com/wp-content/uploads/2011/02/the_fa.jpg";

var playerInstance = jwplayer('myVideo');
playerInstance.setup({
file: path_to_video,
image: path_to_image,
});
playerInstance.on('load', function(){alert();});
//remove overlay for videos
$(".preview_story_info").remove();
</script>

2 Community Answers

dom.einhorn

User  
0 rated :

I didn't see it was version 6, I should have used version 7 for "on" API

Randy

JW Player Support Agent  
0 rated :

Glad to hear you found the snag. Is it working for you now?

This question has received the maximum number of answers.