Advertisement
nrzmalik

Hide Storyline 360 Video Player Control JavaScript

Jul 30th, 2023
444
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.22 KB | Source Code | 0 0
  1. const elementsWithStyleChanges = {
  2.     "modern-video-controls": { position: "none", backgroundColor: "rgba(0, 0, 0, 0)", marginTop: "38px" },
  3.     "video-seekbar": { position: "none", marginTop: "38px" },
  4.     "video-seekbar-hitarea": { position: "none" },
  5.     "video-animation-container": { backgroundColor: "rgba(0, 0, 0, 0)" },
  6.     "control-background": { backgroundColor: "rgba(0, 0, 0, 0)" }
  7. };
  8.  
  9. const classesToHide = ["video-controlbar", "seek-enabled", "elapsed-time-enabled", "volume-enabled", "playback-speed-enabled", "pip-enabled", "full-screen-enabled"];
  10.  
  11. function setStyles() {
  12.     for (const className in elementsWithStyleChanges) {
  13.         const elements = document.getElementsByClassName(className);
  14.         const styles = elementsWithStyleChanges[className];
  15.         for (const element of elements) {
  16.             Object.assign(element.style, styles);
  17.         }
  18.     }
  19. }
  20.  
  21. function hideElements() {
  22.     for (const className of classesToHide) {
  23.         const elements = document.getElementsByClassName(className);
  24.         for (const element of elements) {
  25.             element.style.display = "none";
  26.         }
  27.     }
  28. }
  29.  
  30. function modifyElements() {
  31.     setStyles();
  32.     hideElements();
  33. }
  34.  
  35. modifyElements();
  36.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement