On my website, I'm using a jQuery UI dialog box for some content, which includes video. However, one big problem. Whenever I close the dialog to reopen it (sometimes at the first run), the video downloads instead of plays.
Problems happen with all the players I tried (flowplayer, JW player, etc.). Either the aforementioned, or it doesn't load at all.
And I tried directly from the external page and it was fine, so it has to be a jQuery UI issue.
Is there a way around this? Anyone please? Thanks.
开发者_Go百科function openDialog(url) {
$("<div class='popupDialog'>Loading...</div>")
.dialog({
autoOpen: false,
closeOnEscape: true,
width: '900',
height: 'auto',
modal: true,
title: 'Bonus Features',
autoResize: true,
beforeClose: function(){ $(this).remove(); }
}).bind('dialogclose', function() {
jdialog.dialog('destroy');
}).load(url, function() {
$(this).dialog("option", "position", ['center', 'center'] ).bind('dialogopen', function() {
adjustJQueryDialogOverlay();
});
$(this).dialog("open");
});
}
$(window).resize(function() {
$(".ui-dialog-content").dialog("option", "position", ['center', 'center']);
});
use jquery nyromodal. it will solve all your video related problems.click to view nyromodal demo
精彩评论