Skip to content

Commit

Permalink
Disable AV1 in non-chromium browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
shirt-dev committed May 9, 2022
1 parent 2a06fa2 commit a7bb37d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
25 changes: 22 additions & 3 deletions cadmium-playercore-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
// This script runs as a drop-in replacement of the original cadmium-playercore. This is not a content script.
console.log("Netflix International script active!");

/* eslint-disable no-undef */
// https://stackoverflow.com/a/45985333
function getBrowser() {
if (typeof chrome !== "undefined") {
if (typeof browser !== "undefined") {
return "Firefox";
} else {
return "Chrome";
}
} else {
return "Edge";
}
}

function do_patch(desc, needle, replacement) {
var match = cadmium_src.match(needle);
if (!match) {
Expand Down Expand Up @@ -79,10 +93,15 @@ function get_profile_list() {
"vp9-profile0-L30-dash-cenc",
"vp9-profile0-L31-dash-cenc",
"vp9-profile0-L40-dash-cenc",
"av1-main-L30-dash-cbcs-prk",
"av1-main-L31-dash-cbcs-prk",
"av1-main-L40-dash-cbcs-prk",
]);

if (getBrowser() == "Chrome") {
custom_profiles = custom_profiles.concat([
"av1-main-L30-dash-cbcs-prk",
"av1-main-L31-dash-cbcs-prk",
"av1-main-L40-dash-cbcs-prk",
]);
}
}

custom_profiles = custom_profiles.concat([
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 International",
"description": "Displays all available Netflix audio and subtitle tracks.",
"version": "2.0.13",
"version": "2.0.14",
"author": "shirt",
"browser_action": {
"default_icon": "img/icon128.png",
Expand Down

0 comments on commit a7bb37d

Please sign in to comment.