实现代码
<div id="dplayer"></div> <script src="https://cdn.jsdelivr.net/npm/flv.js@1.5.0/dist/flv.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/dplayer@1.25.1/dist/DPlayer.min.js"></script> <script> var dp = new DPlayer({ container: document.getElementById('dplayer'), //播放器容器 screenshot: true, //截图功能 video:{ url : 'http://192.168.31.66:9999/<%=str%>', } }); </script>
参考
https://blog.csdn.net/weixin_44890856/article/details/106046403