unknown81311/BetterMediaPlayer

[Request/Suggestion] Speed

Rootkit- opened this issue · 0 comments

I coded mine, figured if you wanna impliment into yours, since I modded it off yours.


const appendLoopButtons = (videoButtons) => {
  /** @type {HTMLVideoElement} */
  const video = videoButtons.parentElement.querySelector("video");

  const node = document.createElement("div");
  node.addEventListener("click", () => {
    console.warn(Data.load("playbackrate"))
    if (video.playbackRate == 1) {
        video.playbackRate = 2
        Data.save("playbackRate", 2);
        node.classList.add("BMP_active");
    }else {
        video.playbackRate = 1
        Data.save("playbackRate", 1);
        node.classList.remove("BMP_active");
    }
  });
  
  node.classList.add("BMP_button");
  if (video.playbackRate != 1) node.classList.add("BMP_active");

  node.innerHTML = `<svg class="${classes.controlIcon}" aria-hidden="true" role="img" width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M 10.640625 11.953125 C 10.640625 12.777344 11.304688 13.441406 12.125 13.441406 C 12.703125 13.441406 13.199219 13.109375 13.445312 12.628906 L 13.449219 12.632812 L 16.164062 7.734375 L 11.398438 10.660156 L 11.402344 10.664062 C 10.949219 10.917969 10.640625 11.398438 10.640625 11.953125 Z M 10.640625 11.953125 "/>
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M 18.117188 4.867188 C 16.59375 3.535156 14.625 2.683594 12.375 2.558594 L 12.375 4.820312 C 14.25 4.9375 15.355469 5.53125 16.464844 6.460938 Z M 18.117188 4.867188 "/>
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M 19.179688 11.25 L 21.4375 11.25 C 21.285156 9 20.40625 7.152344 19.039062 5.636719 L 17.441406 7.222656 C 18.402344 8.324219 19.039062 9.75 19.179688 11.25 Z M 19.179688 11.25 "/>
<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M 19.191406 12.375 C 18.953125 16.125 15.84375 19.097656 12.050781 19.097656 C 8.097656 19.097656 4.765625 15.894531 4.765625 11.945312 C 4.765625 8.183594 7.875 5.109375 11.25 4.820312 L 11.25 2.558594 C 6.375 2.851562 2.515625 6.953125 2.515625 11.953125 C 2.515625 17.144531 6.800781 21.347656 11.992188 21.347656 C 17.027344 21.347656 21.210938 17.25 21.453125 12.375 Z M 19.191406 12.375 "/>
</svg>`;

  videoButtons.insertBefore(node, videoButtons.childNodes[1]);
};



function Loops({ width, height }) {
	return React.createElement("svg", {
    width: width,
    height: height,
    viewBox: "0 0 24 24",
    children: [
      React.createElement("path", {
        fill: "currentColor",
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M 10.640625 11.953125 C 10.640625 12.777344 11.304688 13.441406 12.125 13.441406 C 12.703125 13.441406 13.199219 13.109375 13.445312 12.628906 L 13.449219 12.632812 L 16.164062 7.734375 L 11.398438 10.660156 L 11.402344 10.664062 C 10.949219 10.917969 10.640625 11.398438 10.640625 11.953125 Z M 10.640625 11.953125"
      }),
      React.createElement("path", {
        fill: "currentColor",
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M 18.117188 4.867188 C 16.59375 3.535156 14.625 2.683594 12.375 2.558594 L 12.375 4.820312 C 14.25 4.9375 15.355469 5.53125 16.464844 6.460938 Z M 18.117188 4.867188 "
      }),
      React.createElement("path", {
        fill: "currentColor",
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M 19.179688 11.25 L 21.4375 11.25 C 21.285156 9 20.40625 7.152344 19.039062 5.636719 L 17.441406 7.222656 C 18.402344 8.324219 19.039062 9.75 19.179688 11.25 Z M 19.179688 11.25 "
      }),
      React.createElement("path", {
        fill: "currentColor",
        fillRule: "evenodd",
        clipRule: "evenodd",
        d: "M 19.191406 12.375 C 18.953125 16.125 15.84375 19.097656 12.050781 19.097656 C 8.097656 19.097656 4.765625 15.894531 4.765625 11.945312 C 4.765625 8.183594 7.875 5.109375 11.25 4.820312 L 11.25 2.558594 C 6.375 2.851562 2.515625 6.953125 2.515625 11.953125 C 2.515625 17.144531 6.800781 21.347656 11.992188 21.347656 C 17.027344 21.347656 21.210938 17.25 21.453125 12.375 Z M 19.191406 12.375"
      })
    ]
  });
};