gpt4 book ai didi

javascript - 如果 URL 包含字符串 base64,则在 JW Player 启动之前不显示图像

转载 作者:行者123 更新时间:2023-11-28 00:44:48 24 4
gpt4 key购买 nike

不显示图像 JW Player。

图像的 URL 采用 Base64 编码字符串。

如下图选项image所示。

    var file = '/videos/file.mp4',  
image = 'data:image/jpg;base64,/9j/4AAQSkZJABAg...JP1okrOwH//2Q==';

jwplayer('player').setup({
flashplayer: '/jwplayer/jwplayer.flash.swf',
html5player: '/jwplayer/jwplayer.html5.js',
file: file,
image: image
});

JW Player启动前一样显示图像???

最佳答案

播放器的设置完整代码。

<script src="/jwplayer/jwplayer.js"></script>     
<script>
var image = "data:image/jpg;base64,/9j/4AAQSkZJABAg...JP1okrOwH//2Q==",
/* other variables */

onJWPlayerLoad(file, tracksFile, width, height, autostart, image, rtmp);

function onJWPlayerLoad(file, tracksFile, width, height, autostart, image) {
jwplayer.key = 'key';

jwplayer('player').setup({
flashplayer: '/jwplayer/jwplayer.flash.swf',
html5player: '/jwplayer/jwplayer.html5.js',

file: file,

controls: true,

tracks: [{
file: tracksFile,
kind: 'thumbnails'
}],

width: width,
height: height,

autostart: autostart,

image: image
});

}
</script>

关于javascript - 如果 URL 包含字符串 base64,则在 JW Player 启动之前不显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27529598/

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