Embedded jwplayer into jQuery Dialog -
i need put jwplayer inside of dialog, , did how created other dialogs, failed error "typeerror: jwplayer(...).setup not function"
here code follow:
function popupvideoplaydialog(urltorenderedvideo, thumbnailurl, cvid) { // create dialog frame div dialog var dialogframe = document.createelement('div'); dialogframe.setattribute('id', 'videoplaydialog'); // load videos loadvideobyurlwithsize( "videoplaydialog", urltorenderedvideo, thumbnailurl, 640, 480); $dialog = $(dialogframe).dialog({ width : 640, height : 480, modal : true, show : { effect : 'clip', duration : 500 }, hide : { effect : 'clip', duration : 500 }, title : 'video play', buttons: [ {text: "cancel", click: function() {$(this).dialog("close")}} ] }); return false; } function loadvideobyurlwithsize(elementid, videourl, videothumbnail, width, height) { jwplayer(elementid).setup({ file : videourl, image : videothumbnail, width : width, height : height }); }
sorry, realized mistake.
the way call loadvideobyurlwithsize load video not correct, since should not done before dialog created or opened.
here solution, hope helps:
$dialog = $(dialogframe).dialog({ width : 640, height : 480, modal : true, **open: function(){loadvideobyurlwithsize( "videoplaydialog", urltorenderedvideo, thumbnailurl, 640, 480);},** show : { effect : 'clip', duration : 500 }, hide : { effect : 'clip', duration : 500 }, title : 'video play', buttons: [ {text: "cancel", click: function() {$(this).dialog("close")}} ] }); return false;
Comments
Post a Comment