Skip to content

Commit

Permalink
version 1.22.0: ported a feature from the firefox version of this plu…
Browse files Browse the repository at this point in the history
…gin, which allows us to disable the VP9 codec and get higher bitrates (thanks @TheGoddessInari)
  • Loading branch information
jangxx committed Sep 22, 2020
1 parent c8449fd commit 4b1903d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 18 deletions.
9 changes: 5 additions & 4 deletions cadmium-playercore-6.0025.369.012-1080p.js
Original file line number Diff line number Diff line change
Expand Up @@ -59336,9 +59336,6 @@ a000.x6A = (function(I6A) {
"playready-h264hpl30-dash",
"playready-h264hpl31-dash",
"playready-h264hpl40-dash",
"vp9-profile0-L30-dash-cenc",
"vp9-profile0-L31-dash-cenc",
"vp9-profile0-L40-dash-cenc",
"heaac-2-dash",
"heaac-2hq-dash",
"simplesdh",
Expand All @@ -59347,7 +59344,11 @@ a000.x6A = (function(I6A) {
"BIF320"
];

if(globalOptions.use6Channels) {
if (!globalOptions.disableVP9) {
profiles.push("vp9-profile0-L21-dash-cenc", "vp9-profile0-L30-dash-cenc", "vp9-profile0-L31-dash-cenc", "vp9-profile0-L40-dash-cenc");
}

if (globalOptions.use6Channels) {
profiles.push("heaac-5.1-dash");
}

Expand Down
3 changes: 2 additions & 1 deletion content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ function attachScript(resp) {

chromeStorageGet({
use6Channels: true,
setMaxBitrate: true
setMaxBitrate: true,
disableVP9: false,
}).then(items => {
// very messy workaround for accessing chrome storage outside of background / content scripts
let mainScript = document.createElement('script');
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"manifest_version": 2,
"name": "Netflix 1080p",
"description": "Forces 1080p and 5.1 playback for Netflix.",
"version": "1.21.0",
"version": "1.22.0",
"author": "truedread",
"browser_action": {
"default_icon": "img/icon128.png"
Expand Down
10 changes: 5 additions & 5 deletions pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
</head>

<body>
<label>
<input type="checkbox" id="5.1">Use 5.1 audio when available</input>
<br>
<input type="checkbox" id="setMaxBitrate">Automatically select best bitrate available</input>
</label>
<input type="checkbox" id="use51"><label for="use51">Use 5.1 audio when available</label>
<br>
<input type="checkbox" id="setMaxBitrate"><label for="setMaxBitrate">Automatically select best bitrate available</label>
<br>
<input type="checkbox" id="disableVP9"><label for="disableVP9">Disable VP9 codec</label>

<div id="status"></div>
<button id="save">Save</button>
Expand Down
19 changes: 12 additions & 7 deletions pages/options.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
function save_options() {
var use6Channels = document.getElementById('5.1').checked;
var setMaxBitrate = document.getElementById('setMaxBitrate').checked;
const use6Channels = document.getElementById("use51").checked;
const setMaxBitrate = document.getElementById("setMaxBitrate").checked;
const disableVP9 = document.getElementById("disableVP9").checked;

chrome.storage.sync.set({
use6Channels: use6Channels,
setMaxBitrate: setMaxBitrate
use6Channels,
setMaxBitrate,
disableVP9,
}, function() {
var status = document.getElementById('status');
status.textContent = 'Options saved.';
Expand All @@ -16,10 +19,12 @@ function save_options() {
function restore_options() {
chrome.storage.sync.get({
use6Channels: true,
setMaxBitrate: true
setMaxBitrate: true,
disableVP9: false,
}, function(items) {
document.getElementById('5.1').checked = items.use6Channels;
document.getElementById('setMaxBitrate').checked = items.setMaxBitrate;
document.getElementById("use51").checked = items.use6Channels;
document.getElementById("setMaxBitrate").checked = items.setMaxBitrate;
document.getElementById("disableVP9").checked = items.disableVP9;
});
}

Expand Down

0 comments on commit 4b1903d

Please sign in to comment.