我会用变量更改src值以便选择一个频道列表,我想到了一个php文件但不知道如何设置它,将一个url传递给脚本
src: 'http://example.com/streaming/password/playlist.m3u8'
可以这样做吗?
<script>
flowplayer('#player', {
ratio: 0.4167,
background: true,
//splash: true,
clip: {
title: 'Background video',
sources: [{
type: 'application/x-mpegurl',
src: 'http://example.com/streaming/password/playlist.m3u8'
}, {
type: 'video/webm',src: '//stream.flowplayer.org/bauhaus.webm'
}, {
type: 'video/mp4',
src: '//stream.flowplayer.org/bauhaus.mp4'
}]
}
});
</script>
</body>
</html>
答案 0 :(得分:0)
您可以使用jQuery更改元素的src
。喜欢这个
var source = clip.sources.source;
$('#idOfYourElement').attr("src", source);