h1:让浏览器支持flv去https://github.com/Bilibili/flv.js
h2:让手机电脑都支持mp4使用:
<link rel="stylesheet" type="text/css" href="//cdn.bootcss.com/video.js/6.0.0-RC.5/alt/video-js-cdn.min.css"> <script src="http://cdn.bootcss.com/video.js/6.0.0-RC.5/alt/video.novtt.min.js"></script>
这个插件是一个扩展原生html的video标签,使他至此flv格式播放。
<video id="my_video_1" class="video-js vjs-default-skin vjs-big-play-centered" controls></video>
<script type="text/javascript" src="flv.js"></script> <script> if (flvjs.isSupported()) { var videoElement = document.getElementById('my_video_1'); var flvPlayer = flvjs.createPlayer({ type: 'flv', url: '1.flv' }); flvPlayer.attachMediaElement(videoElement); flvPlayer.load(); flvPlayer.play(); } </script>
demo 密码:37lf