Advertisement
Guest User

Untitled

a guest
Sep 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 2.22 KB | None | 0 0
  1. // ==UserScript==
  2. // @name         TwistedTV
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.2
  5. // @description  try to take over the world!
  6. // @author       Gfarro
  7. // @match        http://www.subportal.io/*
  8. // @grant        none
  9. // @require      https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
  10. // @run-at       document-end
  11. // ==/UserScript==
  12.  
  13. var $ = window.jQuery;
  14. var fullscreen = false;
  15.  
  16. (function() {
  17.     'use strict';
  18.  
  19. })();
  20.  
  21. window.addEventListener('load', function() {
  22.     $("#fullscreenHLS").click(function() {
  23.         if(fullscreen == false) {
  24.             //hide elements
  25.             console.log("full screen");
  26.             $(".modal-header").css("display", "none");
  27.             $(".modal-body").css("padding", "0");
  28.             $(".modal-dialog").addClass("modal-dialog-cinema");
  29.             $(".modal-dialog").css("margin", "0");
  30.             $("#myHLSPlayerVideo").css("width", $( document ).width());
  31.             $("#myHLSPlayerVideo").css("height", $( document ).height());
  32.  
  33.             $("#fullscreenHLS").css("position", "absolute");
  34.             $("#fullscreenHLS").css("bottom", "70px");
  35.             $("#fullscreenHLS").css("right", "5px");
  36.  
  37.             $("#myHLSPlayer").css("left", "0");
  38.             $("#myHLSPlayer").css("top", "0");
  39.  
  40.             fullscreen = true;
  41.         } else {
  42.             console.log("remove full screen");
  43.             $(".modal-dialog").removeClass("modal-dialog-cinema");
  44.             $(".modal-header").css("display", "block");
  45.             $(".modal-body").css("padding", "0");
  46.  
  47.             $("#fullscreenHLS").css("position", "");
  48.  
  49.             $("#myHLSPlayerVideo").css("width", "500px");
  50.             $("#myHLSPlayerVideo").css("height", "500px");
  51.             fullscreen = false;
  52.         }
  53.     });
  54. }, false);
  55.  
  56. window.addEventListener('keydown', function(e) {
  57.     console.log("escape fullscreen");
  58.     $(".modal-dialog").removeClass("modal-dialog-cinema");
  59.     $(".modal-header").css("display", "block");
  60.     $(".modal-body").css("padding", "0");
  61.  
  62.     $("#fullscreenHLS").css("position", "");
  63.  
  64.     $("#myHLSPlayerVideo").css("width", "500px");
  65.             $("#myHLSPlayerVideo").css("height", "500px");
  66.  
  67.     fullscreen = false;
  68. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement