我经营一个音乐聚集网站HVmusic.com,在这里我使用Jplayer播放用户添加到列表中的MP3文件。大约一年前,我将站点更改为运行SSL(https),现在发现jPlayer无法播放非SSL网站上托管的任何MP3文件。
这是Jplayer代码的示例。
<script type="text/javascript">
$(document).ready(function(){ // Player instance
$("#jplayer_1").jPlayer({
ready: function () {
$(this).jPlayer("setMedia", {
mp3: "http://ellywininger.com/mp3/Little Red Wagon.mp3"
});
},
play: function() { // To avoid multiple jPlayers playing together.
$(this).jPlayer("pauseOthers");
},
cssSelectorAncestor: "#jp_container_1",
swfPath: "/common/licensed/jplayer",
supplied: "mp3",
useStateClassSkin: true
}); // Player instance
});
</script>
请注意,此人的网站(http://ellywininger.com)实际上运行SSL模式,并且http:重定向到https :,因此这些MP3文件在Jplayer中可以正常播放。
就是那样吗?我不认为这些文件被视为“ SSL页面的一部分”,而是“链接”,并且来自SSL页面的链接可以指向非SSL页面。
感谢您的帮助。