Advertisement
congdantoancau

My youtube javascipt

Apr 15th, 2018
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JAVASCIPT
  2.  
  3. // Manager hotkey
  4. $(document).keyup(function(e) {
  5.     // Media-play/pause key
  6.     if (e.which == 179)
  7.         $('.ytp-play-button').click();
  8. });
  9.  
  10.  
  11. // Youtube autoplay
  12.  
  13. /// Add button controler class style-scope ytd-compact-autoplay-renderer
  14. $('.ytp-chrome-controls').append('<button class="ytp-autoplay-next ytp-button" style="font-size: 2em; text-align: center;"> ⇲</button>');
  15.  
  16. /// Colorize at start
  17. if ($('#toggle').attr('checked', 'true'))
  18.     {
  19.         $('.ytp-autoplay-next').css('color','red');
  20.     }
  21.     else
  22.     {
  23.         $('.ytp-autoplay-next').css('color','white');
  24.     }
  25.  
  26. /// Control
  27. $('.ytp-autoplay-next').click(function() {
  28.     if ($('#toggle').attr('checked'))
  29.     {
  30.         $('#toggle').removeAttr('checked');
  31.         $(this).css('color','white');
  32.     }
  33.     else
  34.     {
  35.         $('#toggle').attr('checked', true)
  36.         $(this).css('color','red');
  37.     }
  38. });
  39.  
  40.  
  41.  
  42. // CSS STYLES
  43. #related, .adDisplay.wide-overlay-ad, .ytp-endscreen-content {display: none !important;}
  44. #container, #player {margin-left: 15%;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement