Skip to content

Commit

Permalink
add option
Browse files Browse the repository at this point in the history
  • Loading branch information
lkmvip committed Jul 29, 2020
1 parent 53dbef0 commit 940251e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cadmium-playercore-6.0023.976.031.js
Original file line number Diff line number Diff line change
Expand Up @@ -22380,7 +22380,9 @@ v3YY.l94 = function () {
a.Hra = [a.GJ, a.HJ, a.OD, a.IJ, a.zS, a.AS];
a.mqa = [a.tJ, a.CD, a.wJ, a.uJ, a.vJ, a.gS];
a.pLb = [a.tJ, a.uJ, a.CD, a.vJ, a.wJ];
a.fWa = [a.wS, a.xS, a.N4];
if (!useAVC){
a.fWa = [a.wS, a.xS, a.N4];
}
a.jQb = [a.$T, a.aU, a.bU];
a.Mw = [a.lya, a.$T, a.aU, a.bU, a.gya, a.hya, a.iya, a.jya, a.kya];
a.$Va = [a.ioa, a.joa, a.koa];
Expand Down
4 changes: 3 additions & 1 deletion content_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ urls = [
]

// very messy workaround for accessing chrome storage outside of background / content scripts
chrome.storage.sync.get(['useallSub', 'useddplus', 'setMaxBitrate'], function(items) {
chrome.storage.sync.get(['useallSub', 'useddplus', 'useAVC', 'setMaxBitrate'], function(items) {
var useallSub = items.useallSub;
var useddplus = items.useddplus;
var useAVC = items.useAVC;
var setMaxBitrate = items.setMaxBitrate;
var mainScript = document.createElement('script');
mainScript.type = 'application/javascript';
mainScript.text = 'var useallSub = ' + useallSub + ';' + '\n'
+ 'var useddplus = ' + useddplus + ';' + '\n'
+ 'var useAVC = ' + useAVC + ';' + '\n'
+ 'var setMaxBitrate = ' + setMaxBitrate + ';';
document.documentElement.appendChild(mainScript);
});
Expand Down
4 changes: 3 additions & 1 deletion pages/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
<label>
<input type="checkbox" id="allSub">Open all sub and track</input>
<br>
<input type="checkbox" id="ddplus">Use ddplus track (Note... If you are not Win10, please close this)</input>
<input type="checkbox" id="ddplus">Use ddplus track</input>
<br>
<input type="checkbox" id="AVC">Use AVC, NOT Avchigh video code</input>
<br>
<input type="checkbox" id="setMaxBitrate">Automatically select best bitrate available</input>
</label>
Expand Down
4 changes: 4 additions & 0 deletions pages/options.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
function save_options() {
var useallSub = document.getElementById('allSub').checked;
var useddplus = document.getElementById('ddplus').checked;
var useAVC = document.getElementById('AVC').checked;
var setMaxBitrate = document.getElementById('setMaxBitrate').checked;
chrome.storage.sync.set({
useallSub: useallSub,
useddplus: useddplus,
useAVC: useAVC,
setMaxBitrate: setMaxBitrate
}, function() {
var status = document.getElementById('status');
Expand All @@ -19,10 +21,12 @@ function restore_options() {
chrome.storage.sync.get({
useallSub: false,
useddplus: false,
useAVC: false,
setMaxBitrate: false
}, function(items) {
document.getElementById('allSub').checked = items.useallSub;
document.getElementById('ddplus').checked = items.useddplus;
document.getElementById('AVC').checked = items.useAVC;
document.getElementById('setMaxBitrate').checked = items.setMaxBitrate;
});
}
Expand Down

2 comments on commit 940251e

@jangxx
Copy link

@jangxx jangxx commented on 940251e Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick question: Does the "disable avchigh" stuff actually work for you in Edge? Someone asked me to integrate it into the chrome version and I did it by simply removing the playready-h264hpl*-dash profiles from the list (which seems to be the same thing you are doing), but all this does is causing the Netflix player to not work anymore.

@lkmvip
Copy link
Owner

@lkmvip lkmvip commented on 940251e Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can work on edge

Please sign in to comment.