我希望当用户点击播放时,首先看到带有链接的图像,然后为他播放视频,我该怎么做?
喜欢此链接:aparat
我的代码
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: 'video.mp4',
width: 640,
height: 360,
title: 'Basic Video Embed',
description: 'A video with a basic title and description!',
primary: 'html5'
});
答案 0 :(得分:1)
点击播放是播放器的默认行为。您可以在设置中添加图片文件。如果你想添加自动播放(与你上面描述的相反,只需添加“autostart:true”,
<div id="myElement"></div>
<script>
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "/uploads/myVideo.mp4",
image: "/uploads/myImage.jpg",
width: 640,
height: 270,
mute: true
});
</script>