laSexta.com HTML5 player

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

当前为 2015-05-27 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name laSexta.com HTML5 player
  3. // @name:es Reproductor HTML5 en laSexta.com
  4. // @namespace userscripts.org/swyter
  5. // @description HTML5 player for laSexta.com, avoiding the Flash Player plugin.
  6. // @description:es Reproductor HTML5 para laSexta.com, evitando el uso del plugin Flash Player.
  7. // @match http://www.lasexta.com/*
  8. // @version 1.1
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. if ((videoDataUrl = document.querySelector("*[name=videoDataUrl]").value))
  13. {
  14. xhr = new XMLHttpRequest();
  15.  
  16. xhr.open("GET", videoDataUrl);
  17.  
  18. xhr.onreadystatechange = function()
  19. {
  20. if (this.readyState != xhr.DONE) return;
  21.  
  22. /* build our own html5 player with our own stuff */
  23. vplayer = document.createElement("video");
  24.  
  25. vplayer.src = this.responseXML.getElementsByTagName("videoSource")[0].textContent;
  26. vplayer.poster = this.responseXML.getElementsByTagName("background")[0].textContent;
  27.  
  28. vplayer.controls = "true";
  29. vplayer.volume = "0.4";
  30.  
  31. vplayer.style = 'width: 644px; height: 362px;';
  32.  
  33. /* replace it on the page */
  34. videoHolderElement = document.querySelector("*[itemprop='Video']");
  35. videoHolderElement.parentElement.replaceChild(vplayer, videoHolderElement);
  36. }
  37.  
  38. xhr.send();
  39. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址