gpt4 book ai didi

jquery - jPlayer 在 chrome 上停止调用 jQuery.load() 方法刷新内容,但在 Firefox 上工作

转载 作者:行者123 更新时间:2023-11-30 23:44:34 25 4
gpt4 key购买 nike

我正在使用 jPlayer 来播放音频。我们需要比赛不间断。为此,我们使用 jQuery.load() 方法加载页面内容并替换页面上的内容。

我们不会以任何方式刷新 jPlayer 内容。

该代码在 Firefox 中运行良好,并且 jPlayer 可以不间断地播放音频。但在 chrome 和 safari 上,jPlayer 会在执行完 jquery load 方法后停止并重新启动。

此外,当我在本地计算机上运行代码时,它们在任何浏览器中都不会中断。仅当我在服务器上运行代码时,它们才会中断。

我们需要不间断的音乐。

我的代码如下:

function loadContent(pagePath) {
//Method called on menu click to load content without page refresh
//Loading the said page (pagePath - relative path of page)
jQuery('#containerDiv').fadeOut(200, function() {
jQuery('#waitingDiv').show();
jQuery(this).empty();
jQuery(this).load(pagePath, function() {
jQuery(this).fadeIn(200, function() {
jQuery('#waitingDiv').hide();
});
});
});
}

//JPlayer initiation code on first page load
jQuery("#jquery_jplayer_1").jPlayer({
ready: function () {
jQuery(this).jPlayer("setMedia", {mp3: '../'+path});
},
swfPath: "../swf",
supplied: "mp3",
wmode: "window"
});

有什么建议吗?

谢谢阿基莱什·阿加瓦尔

最佳答案

尝试将 JPlayer 启动代码移至 loadContent 函数上方

关于jquery - jPlayer 在 chrome 上停止调用 jQuery.load() 方法刷新内容,但在 Firefox 上工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14100591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com