Video.js 引入及配置正确,但是实际就是不显示播放器。
代码:
<div id="plv_vediobox" class="video-js vjs-default-skin"></div>
var player = videojs('plv_vediobox',{
controls: true,
preload: 'auto',
width:'800px',
height:'600px',
language: 'zh-CN',
sources:
[{
src: '{$content.video|substr=0,32}.mp4',
type: 'video/mp4',
}]
});
实际显示:

反复对比才发现,犯了个低级错误。Video.js要求的元素是video,而我上面的代码中写的是div,只要将容器元素修改为video就可以了。
<video id="plv_vediobox" class="video-js vjs-default-skin">
<!-- 视频源将在JS中动态添加 -->
</video>
var player = videojs('plv_vediobox',{
controls: true,
preload: 'auto',
width:'800px',
height:'600px',
language: 'zh-CN',
sources:
[{
src: '{$content.video|substr=0,32}.mp4',
type: 'video/mp4',
}]
});





