
Dynamically load video
Hey i'm having issues when I want to load a new video in the player, it shows this error:
Error loading player:
No playable sources found
and in the console says: Uncaught TypeError: Cannot read property 'googima' of undefined (jwplayer.js:128)
My code is this:
jwplayer('video_player').setup({
'flashplayer': 'js/jwplayer/jwplayer.flash.swf',
'controlbar': 'bottom',
'width': '596',
'height': '374'
});
$(".media").on('click', function(e) {
var $item = $(this);
var video = $item.attr('data-video');
var image = $item.attr('data-image');
if (typeof video != 'undefined') {
var new_video = {
file: video,
image: (typeof image != 'undefined') ? image : ""
};
jwplayer().load(new_video);
jwplayer().play();
}
e.preventDefault();
});
what is wrong?
help me please.