This repository has been archived by the owner on Mar 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
1,541 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
high-definition-video | ||
High Definition Video | ||
===================== | ||
|
||
Firefox addon that makes HD the default video quality. | ||
Supported video players: | ||
- YouTube | ||
- _more added on request_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@echo off | ||
setlocal | ||
|
||
for /F "usebackq tokens=3 delims=<>" %%v in (`type install.rdf ^| findstr /irc:"em:version"`) do ( | ||
set version=%%v | ||
) | ||
|
||
7za a -tzip high_definition_video-%version%-fx.xpi -i@build.include -x@build.exclude | ||
exit /B 0 |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
chrome\ | ||
chrome.manifest | ||
install.rdf | ||
icon.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
content hdv chrome/content/ contentaccessible=yes | ||
overlay chrome://browser/content/browser.xul chrome://hdv/content/browserOverlay.xul |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var hdv = { | ||
init: function() { | ||
if (gBrowser) gBrowser.addEventListener("DOMContentLoaded", this.onDOMContentLoaded); | ||
}, | ||
onDOMContentLoaded: function(event) { | ||
var doc = event.originalTarget; | ||
if (!doc || !doc.body) return; | ||
|
||
var script = doc.createElement('script'); | ||
script.setAttribute("type", "application/javascript"); | ||
script.setAttribute("src", "chrome://hdv/content/hdv.js"); | ||
doc.body.appendChild(script); | ||
} | ||
} | ||
|
||
window.addEventListener("load", function() { | ||
hdv.init(); | ||
window.removeEventListener("load", this, false); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<overlay id="hdv_browserOverlay" | ||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> | ||
<script src="chrome://hdv/content/browserOverlay.js"/> | ||
</overlay> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* @see https://developers.google.com/youtube/js_api_reference | ||
*/ | ||
function onYouTubePlayerReady(player){ | ||
// The onYouTubePlayerReady() is called twice. During first call the 'player' | ||
// parameter equals to player ID string. On the second call it equals to | ||
// the player object. Make sure we respond to the second call only. | ||
if (player && typeof player === "object") { | ||
// We need to be little bit stubborn about playback quality setting, because: | ||
// a) getAvailableQualityLevels() sometimes returns empty array | ||
// b) YouTube website is forcing default quality between 0 - 3000 ms of | ||
// playback (I didn't observe this with embedded video though) | ||
var intervalId = window.setInterval(function() { | ||
var highestQuality = player.getAvailableQualityLevels()[0] || "highres"; | ||
if (player.getPlaybackQuality() === highestQuality) { | ||
window.clearInterval(intervalId); | ||
} else { | ||
player.setPlaybackQuality(highestQuality); | ||
} | ||
}, 100); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | ||
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> | ||
|
||
<Description about="urn:mozilla:install-manifest"> | ||
<em:id>hdv@vovcacik.addons.mozilla.org</em:id> | ||
<em:type>2</em:type> | ||
|
||
<em:name>High Definition Video</em:name> | ||
<em:version>1.0</em:version> | ||
<em:description>Makes HD the default video quality.</em:description> | ||
<em:creator>Vlastimil Ovčáčík</em:creator> | ||
<em:homepageURL>https://addons.mozilla.org/addon/high-definition-video/</em:homepageURL> | ||
|
||
<em:targetApplication> | ||
<Description> | ||
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> | ||
<em:minVersion>9.0</em:minVersion> | ||
<em:maxVersion>28.0a1</em:maxVersion> | ||
</Description> | ||
</em:targetApplication> | ||
|
||
</Description> | ||
</RDF> |