使用video.js支持flv格式

html5的video标签只支持mp4、webm、ogg三种格式,不支持flv格式,在使用video.js时,如果使用html5是会报错不支持。

修改了一下代码

js部分

videojs.options.flash.swf = "{{ config.app.static_url }}assets/flash/video-js.swf";

html部分

<video  class="video-js vjs-default-skin" controls preload="none" width="500" height="280"  data-setup="{}"
                                                src="{{ config.app.upload_url }}{{scene.video_file}}">
                                                    <source src="{{ config.app.upload_url }}{{scene.video_file}}" type="video/flv">
                                            </video>

这样flv格式的视频就是调用flash加载

原文地址:https://www.cnblogs.com/myzy/p/6475032.html