Skip to content

Commit

Permalink
Merge pull request #1696 from raszpl/raszpl-patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
ImprovedTube authored May 23, 2023
2 parents 76c5f59 + 0f81470 commit 3dd2428
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
12 changes: 8 additions & 4 deletions js&css/satus.js
Original file line number Diff line number Diff line change
Expand Up @@ -2967,7 +2967,9 @@ satus.user.browser.audio = function() {
types = {
mp3: 'audio/mpeg',
mp4: 'audio/mp4',
aif: 'audio/x-aiff'
aif: 'audio/x-aiff',
'AAC-LC': 'audio/mp4; codecs="mp4a.40.2"',
opus: 'audio/webm; codecs="opus"'
},
result = [];

Expand All @@ -2992,10 +2994,12 @@ satus.user.browser.audio = function() {
satus.user.browser.video = function() {
var video = document.createElement('video'),
types = {
ogg: 'video/ogg; codecs="theora"',
h264: 'video/mp4; codecs="avc1.42E01E"',
webm: 'video/webm; codecs="vp8, vorbis"',
//ogg: 'video/ogg; codecs="theora"',
'H.264 Baseline Profile 3.0': 'video/mp4; codecs="avc1.42E01E"',
'H.264 Main Profile 4.0': 'video/mp4; codecs="avc1.640028"',
//webm: 'video/webm; codecs="vp8, vorbis"',
vp9: 'video/webm; codecs="vp9"',
av1: 'video/mp4; codecs=av01.0.05M.08',
hls: 'application/x-mpegURL; codecs="avc1.42E01E"'
},
result = [];
Expand Down
15 changes: 9 additions & 6 deletions menu/skeleton-parts/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -731,17 +731,17 @@ extension.skeleton.main.layers.section.player.on.click = {
on: {
render: function () {
if (satus.storage.get('player_h264')) {
if (this.childNodes[1].textContent === 'Video disabled') {
this.childNodes[1].style = '';
this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text;
} else if (this.childNodes[2].selectedIndex >6) {
if (this.childNodes[2].selectedIndex >6) {
this.childNodes[1].style = 'color: red!important; font-weight: bold;';
this.childNodes[1].textContent = '1080p';
} else {
this.childNodes[1].style = '';
this.childNodes[1].textContent = this.childNodes[2].options[this.childNodes[2].selectedIndex].text;
}
for (let index =7; index <= 10; index++) {
this.childNodes[2].childNodes[index].style = 'color: red!important; font-weight: bold;';
}
} else if (satus.storage.get('block_vp9') && satus.storage.get('block_av1') && satus.storage.get('block_h264')) {
} else if (satus.storage.get('block_vp9') && satus.storage.get('block_h264')) {
this.childNodes[1].style = 'color: red!important; font-weight: bold;';
this.childNodes[1].textContent = 'Video disabled';
} else {
Expand Down Expand Up @@ -861,9 +861,12 @@ extension.skeleton.main.layers.section.player.on.click = {
render: function () {
var codecs = (satus.storage.get('block_h264') ? '' : 'h.264 ') + (satus.storage.get('block_vp9') ? '' : 'vp9 ') + (satus.storage.get('block_av1') ? '' : 'av1');

if (codecs) {
if (codecs.includes('h.264') || codecs.includes('vp9')) {
this.style = '';
this.textContent = codecs;
} else if (codecs) {
this.style = 'color: red!important; font-weight: bold;';
this.textContent = codecs;
} else {
this.style = 'color: red!important; font-weight: bold;';
this.textContent = 'none';
Expand Down

0 comments on commit 3dd2428

Please sign in to comment.