laSexta.com HTML5 player

HTML5 player for laSexta.com, avoiding the Flash Player plugin.

2015-05-27 या दिनांकाला. सर्वात नवीन आवृत्ती पाहा.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name           laSexta.com HTML5 player
// @name:es        Reproductor HTML5 en laSexta.com
// @namespace      userscripts.org/swyter
// @description    HTML5 player for laSexta.com, avoiding the Flash Player plugin.
// @description:es Reproductor HTML5 para laSexta.com, evitando el uso del plugin Flash Player.
// @match          http://www.lasexta.com/*
// @version        1.1
// @grant          none
// ==/UserScript==

if ((videoDataUrl = document.querySelector("*[name=videoDataUrl]").value))
{
  xhr = new XMLHttpRequest();

  xhr.open("GET", videoDataUrl);

  xhr.onreadystatechange = function()
  {
    if (this.readyState != xhr.DONE) return;

    /* build our own html5 player with our own stuff */
    vplayer = document.createElement("video");

    vplayer.src    = this.responseXML.getElementsByTagName("videoSource")[0].textContent;
    vplayer.poster = this.responseXML.getElementsByTagName("background")[0].textContent;

    vplayer.controls = "true";
    vplayer.volume = "0.4";

    vplayer.style = 'width: 644px; height: 362px;';

    /* replace it on the page */
    videoHolderElement = document.querySelector("*[itemprop='Video']");
    videoHolderElement.parentElement.replaceChild(vplayer, videoHolderElement);
  }

  xhr.send();
}