标签:type controls ie8 his please sid styles dia encrypt
django实现视频播放并适配主流浏览器,应用比较广泛的就是videojs了。
<head> <link href="http://vjs.zencdn.net/6.6.3/video-js.css" rel="stylesheet"> <!-- If you‘d like to support IE8 --> <script src="http://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> </head> <body> <video id="my-video" class="video-js" controls preload="auto" width="640" height="264" poster="MY_VIDEO_POSTER.jpg" data-setup="{}"> <source src="MY_VIDEO.mp4" type=‘video/mp4‘> <source src="MY_VIDEO.webm" type=‘video/webm‘> <p class="vjs-no-js"> To view this video please enable JavaScript, and consider upgrading to a web browser that <a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a> </p> </video> <script src="http://vjs.zencdn.net/6.6.3/video.js"></script> </body>
但是也有一点局限性,视频格式需为mp4,或者mkv。(其中mp4格式也有要求)关于断点,进度条的问题,由于没有在本地搭建视频服务器,这个就需要上传至云对象储存。
<body> <iframe width="854" height="480" src="" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe> </body>
也可达到简陋版。
标签:type controls ie8 his please sid styles dia encrypt
原文地址:https://www.cnblogs.com/zenan/p/8783165.html