Vertical Stream Magic

Adjust Twitch streams for a vertical orientated monitor.

Stan na 12-12-2016. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name          Vertical Stream Magic
// @namespace     http://greasyfork.org/users/2240-doodles
// @author        Doodles
// @version       1
// @description   Adjust Twitch streams for a vertical orientated monitor.
// @include       *://www.twitch.tv/*
// @exclude       *://www.twitch.tv/*/*
// @exclude       *://www.twitch.tv/settings
// @require       https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js
// @updateVersion 1
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);
$(document).ready(function () {
	'use strict';
	if($("meta[property='og:video']").length !== 0 && $("meta[property='og:video']").attr("content").indexOf("channel=") != -1){
		var channelName = document.URL.split("twitch.tv/")[1].split("&")[0].split("#")[0];
		$('script').each(function () { $(this).remove(); });
		$('body').html('' + 
			'<iframe src="https://player.twitch.tv/?channel='+channelName+'" id="stream" height="603" width="1072" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>' + 
			'<iframe src="https://www.twitch.tv/'+channelName+'/chat?popout=" id="chat" height="633" width="1072" frameborder="0" scrolling="no" allowfullscreen="true"></iframe>' + 
		'');
		$('head').html('<title>'+channelName+'</title>');
		$('body').css({'background-color': '#ffe', 'padding': '0 0 0 0' , 'margin': '0 0 0 0' });
		$('iframe').css({'padding': '0 0 0 0' , 'margin': '0 0 0 0', 'display' : 'block' });
	}
});