我需要将我的 jwplayer 放在一个对话框中,我按照创建其他对话框的方式进行操作,但它失败并出现错误“TypeError:jwplayer(...).setup is not a function”
这是我的代码如下:
function popupVideoPlayDialog(urlToRenderedVideo, thumbnailUrl, cvId) {
// create dialog frame div for 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
});
}