Fullscreen VoiceTube

Make VoiceTube Video FullScreen !

  1. // ==UserScript==
  2. // @name Fullscreen VoiceTube
  3. // @namespace fullscreen.voicetube
  4. // @description Make VoiceTube Video FullScreen !
  5. // @include https://*.voicetube.com/*
  6. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
  7. // @version 1.3
  8. // @grant none
  9. // @icon http://tw.blog.voicetube.com/wp-content/uploads/2014/07/unnamed-2.png
  10. // ==/UserScript==
  11.  
  12. jQuery.noConflict()
  13.  
  14. if (location.hostname.charAt(0) == "w") {
  15. subdomain = "www"
  16. fullscreen = "Fullscreen"
  17. } else if (location.hostname.charAt(0) == "t") {
  18. subdomain = "tw"
  19. fullscreen = "全螢幕播放"
  20. }
  21.  
  22. if (location.pathname.search(/videos/) >= 0) {
  23. var VideoPATH = location.pathname
  24. var VideoID = VideoPATH.substring(VideoPATH.indexOf("s/") + 2, VideoPATH.indexOf("s/") + 7)
  25. var EmbedURL = 'https://' + subdomain + '.voicetube.com/embed/' + VideoID
  26. jQuery('#embed-section').append('<a href="javascript:;" id="fullscreenBtn">&nbsp;' + fullscreen + '</a>')
  27. jQuery('#fullscreenBtn').click(function() {
  28. window.open(EmbedURL, '_blank')
  29. })
  30. } else if (location.pathname.search(/embed/) >= 0) {
  31. var browserHeight = jQuery(window).height()
  32. var YTContainerHeight = browserHeight * 0.85
  33. jQuery('#youtube').css("height", YTContainerHeight + 'px')
  34. jQuery('#caption_block').css({
  35. "font-size": "200%",
  36. "line-height": "150%"
  37. })
  38. };