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

Popular posts from this blog

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -