gpt4 book ai didi

javascript - flowplayer:coverImage 作为数据属性

转载 作者:太空宇宙 更新时间:2023-11-04 13:21:32 24 4
gpt4 key购买 nike

我这样调用 flowplayer:

flowplayer("a.rmPlayer", "libs/flowplayer/flowplayer.swf", {
plugins: {
audio: {
url: 'libs/flowplayer/flowplayer.audio.swf'
},
controls: {
volume: true
}
}
});

我现在想为每个被调用的 mp3 文件设置不同的封面。 flowplayer 提供了 coverimage 变量(参见 http://flash.flowplayer.org/plugins/streaming/audio.html ),但是我能以某种方式将图像放在数据属性中吗?

最佳答案

我最终使用了以下代码,它似乎可以完美运行。链接:

<a data-toggle="modal" class="rmPlayer" data-fpurl="http://releases.flowplayer.org/data/fake_empire.mp3" data-fpimg="http://releases.flowplayer.org/data/national.jpg">click me</a>

和相应的javascript('#rmPlayerInterface'是模态窗口)

<script type="text/javascript">
$(document).ready(function() {
player = flowplayer("player", "/libs/flowplayer/flowplayer.swf", {
plugins: {audio: {url: '/libs/flowplayer/flowplayer.audio.swf'},controls: {url: '/libs/flowplayer/flowplayer.controls.swf'}},
clip: {autoplay: false, autoBuffering: true}
});

$(document).on("click", ".rmPlayer", function () {
$('#rmPlayerInterface').data('playeroptions', $(this).data());//.music = music;
$('#rmPlayerInterface').modal('show');//:music});//('music', $(this).data('music'));
});

$('#rmPlayerInterface').on('show', function () {
var poptions = $('#rmPlayerInterface').data('playeroptions');
var c = {url: poptions["fpurl"],coverImage: {url: poptions["fpimg"],scaling: 'orig'}};
player.play(c);
});

$('#rmPlayerInterface').on('hide', function () {
player.pause();
});
});

</script>

关于javascript - flowplayer:coverImage 作为数据属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16529251/

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