根据自己需要简单改了几个地方 lz 看看有没有用得上的
---
let style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = "#video_speed_div button {padding: 0 5px; margin-left: 2px; background: #eee; border: 0; color: #888; cursor: pointer;} .video_speed_div-button-active {background-color: #00b5e5!important; color: #fff!important;}";
document.getElementsByTagName('head').item(0).appendChild(style);
let videoSpeedElement = document.createElement("div");
videoSpeedElement.setAttribute("id", "video_speed_div");
let speedList = [1,1.25,1.5,2,3,4,5]
for(let i in speedList){
let spd = speedList[i]
let btn = document.createElement("button");
btn.innerHTML = "x"+spd;
btn.setAttribute("id", "third_video_plugin_btn_"+spd);
btn.addEventListener("click", changeVideoSpeed);
videoSpeedElement.appendChild(btn);
}
let videoElement = document.querySelector("#playerWrap");
let videoWidth = videoElement.clientWidth;
let videoHeight = videoElement.clientHeight;
let videoOffsetTop = videoElement.offsetTop;
let videoOffsetLeft = videoElement.offsetLeft;
videoSpeedElement.style.textAlign = "right";
videoSpeedElement.style.width = "300px";
videoSpeedElement.style.height = "30px";
videoSpeedElement.style.position = "absolute";
videoSpeedElement.style.top = (videoOffsetTop - 32) + "px";
videoSpeedElement.style.left = (videoOffsetLeft + videoWidth - 300) + "px";
document.body.appendChild(videoSpeedElement);