<div class="col-md-12 center"id="cms_player" style="height:400px">
div id='preVideo' style="width: 100%;height: 100%;display:none"></div>
<div id='myVideo' style="width: 100%;height: 100%"></div>
<script src="/static/hls.min.js"></script>
<script src="/static/DPlayer.min.js"></script>
<script type="text/javascript">
var myVideo = new DPlayer({
container: document.getElementById('myVideo'),
screenshot: true,
logo: '/logosg.png',
autoplay:false,
video: {
url: ‘https://sina.com-h-sina.com/20180812/8109_c3c7716c/index.m3u8’,
type: 'hls'
}
});
myVideo.currentTime = function() {
return myVideo.video.currentTime;
}
</script>
</div>
谢谢各位大佬!
多看看大佬写的规则,然后多练练就会了,前提是要懂点 js
match(/http.*?m3u8/)[0]
用正则法提取链接。