Video Repubblica in HTML5

Allows to watch MP4 videos on the Repubblica.it website with a HTML5 container

当前为 2017-11-19 提交的版本,查看 最新版本

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Video Repubblica in HTML5
// @namespace    http://andrealazzarotto.com/
// @version      1.0.2
// @description  Allows to watch MP4 videos on the Repubblica.it website with a HTML5 container
// @author       Andrea Lazzarotto
// @match        http://video.repubblica.it/*
// @match        https://video.repubblica.it/*
// @copyright    2012+, Andrea Lazzarotto - GPLv3 License
// @require      http://code.jquery.com/jquery-latest.min.js
// @license      GPL version 3 or any later version; http://www.gnu.org/copyleft/gpl.html
// ==/UserScript==

$(document).ready(function() {
	var contentURL = $('meta[itemprop=contentUrl]').attr('content');
	if(!!contentURL && contentURL.indexOf('.mp4') > 0)
		$('#playerCont').empty().append('<video src="' + contentURL + '" controls autoplay width="100%" height="100%"></video>');
	var isEmbed = (location.href.indexOf("repubblica.it/embed") > 0 && !!unsafeWindow.player_1);
	if (isEmbed && !!unsafeWindow.player_1.model.formats.mp4) {
		$('#player').empty().append('<video src="' + unsafeWindow.player_1.model.formats.mp4 + '" controls autoplay style="width: 100%; height: 100vh"></video>');
		$("body").css("overflow", "hidden");
        $("video.reptv-html5player").remove();
	}
});