Large

ViewTube

By sebaro Last update Jun 17, 2013 — Installed 110,892 times.

Prefer YouTube's HTML5 player if applicable

in
Subscribe to Prefer YouTube's HTML5 player if applicable 3 posts, 3 voices



Pacco User
FirefoxX11

I use ViewTube to view YouTube videos in HTML5 that are "unavailable", and I would like to disable ViewTube for those videos that are already available in HTML5 on YouTube. So I wrote a patch for ViewTube that fits those personal needs of mine. I realize that not everybody else is using ViewTube for my purposes, some might want to block YouTube's HTML5 player, too. So I don't expect this patch to be applied to the main line of the ViewTube script, but I still offer my solution to everyone who has the same needs as I do.

This patch is released under the Gnu General Public License Version 3, or (at your option) any later version. Original ViewTube by Copyright (C) 2010 - 2012 Sebastian Luncan

// ==========Websites========== //

// =====YouTube===== //

if (page.url.indexOf('youtube.com/watch') != -1) {

/* Check Video Availability */
if (getMyElement ('', 'div', 'id', 'watch-player-unavailable', -1, false)) return;

/* Do not apply this script if the YouTube HTML5 player is found, that is
* when the video does not run advertisements and your browser supports a
* Mime type for HTML5 playback that the video is currently available in.
* Newly uploaded videos are only available in the format they were uploaded in.
*/
var hashtml5 = getMyElement ('', 'div', 'class', 'html5-player', -1, false);

if (hashtml5.length > 0) return;

/* YouTube Main Function */
function youtube() {

 
sebaro Script's Author
OperaX11

Hi Pacco,
All patches or suggestions are welcome.

I can't implement this as an option in the script's panel because it disables the script and there's no way to enable it back. Your solution (to modify/patch the script source code) is the only way to do this.

 
Arthur M User
FirefoxMacintosh

if (check_html) {

}else {

}