laSexta.com HTML5 player

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

Pada tanggal 27 Mei 2015. Lihat %(latest_version_link).

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==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();
}