0
我需要將我的jwplayer放入一個對話框中,並且我是這樣創建其他對話框的,但它失敗了,出現錯誤「TypeError:jwplayer(...)。setup不是函數「將jwplayer嵌入到jQuery對話框中
這裏是我的代碼如下:
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
});
}