const videoRef = document.getElementById("vidoeRef"); const dp = new DPlayer({ // 挂载元素 container: videoRef, // 主题色 theme: "#1DA6BA", // 是否支持视频截图 screenshot: true, video: { // 视频地址 url: this.url, }, });
<form> <video width="480" src="https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/812358b69886e576c66a01f1f00affe9.mp4" controls /> <div id="videoRef" style="width: 480px; height: 270px;"></div> </form>