Skip to content

Commit df11d35

Browse files
authored
Merge pull request #3453 from majiayu000/fix/issue-3427-hide-pause-overlay
feat: Add Hide Pause Overlay option for main player (fixes #3427)
2 parents a5493d1 + c86525c commit df11d35

File tree

4 files changed

+94
-0
lines changed

4 files changed

+94
-0
lines changed

_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -737,6 +737,9 @@
737737
"hideSkipOverlay": {
738738
"message": "Hide 5 second skip animation"
739739
},
740+
"hidePauseOverlay": {
741+
"message": "Hide Pause Overlay"
742+
},
740743
"hideThumbnailOverlay": {
741744
"message": "Hide buttons on thumbnails"
742745
},

js&css/extension/www.youtube.com/appearance/player/player.css

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,3 +761,15 @@ html[it-revert-theater-button-size='true'] .html5-video-player.ytp-big-mode .ytp
761761
display: flex;
762762
align-items: center;
763763
}
764+
765+
/*--------------------------------------------------------------
766+
# HIDE PAUSE OVERLAY (BEZEL)
767+
--------------------------------------------------------------*/
768+
html[it-player-hide-pause-overlay='true'] .ytp-bezel-text-wrapper,
769+
html[it-player-hide-pause-overlay='true'] .ytp-bezel,
770+
html[it-player-hide-pause-overlay='true'] .ytp-bezel-text,
771+
html[it-player-hide-pause-overlay='true'] .ytp-pause-overlay {
772+
display: none !important;
773+
opacity: 0 !important;
774+
visibility: hidden !important;
775+
}

menu/skeleton-parts/appearance.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@ extension.skeleton.main.layers.section.appearance.on.click.player = {
403403
value: false,
404404
tags: "remove,hide"
405405
},
406+
player_hide_pause_overlay: {
407+
component: "switch",
408+
text: "hidePauseOverlay",
409+
value: false,
410+
tags: "remove,hide,pause,bezel"
411+
},
406412
player_remaining_duration: {
407413
component: "switch",
408414
text: "showRemainingDuration",
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
// Test for Issue #3427: Hide Pause Overlay option
2+
3+
const fs = require('fs');
4+
const path = require('path');
5+
6+
describe('Hide Pause Overlay Feature', () => {
7+
describe('Menu Configuration', () => {
8+
let appearanceContent;
9+
10+
beforeAll(() => {
11+
const appearancePath = path.join(__dirname, '../../menu/skeleton-parts/appearance.js');
12+
appearanceContent = fs.readFileSync(appearancePath, 'utf8');
13+
});
14+
15+
test('player_hide_pause_overlay option should exist in appearance.js', () => {
16+
expect(appearanceContent).toContain('player_hide_pause_overlay');
17+
});
18+
19+
test('player_hide_pause_overlay should use hidePauseOverlay text key', () => {
20+
expect(appearanceContent).toContain("text: \"hidePauseOverlay\"");
21+
});
22+
23+
test('player_hide_pause_overlay should be a switch component', () => {
24+
// Check that there's a switch component for player_hide_pause_overlay
25+
const pauseOverlayMatch = appearanceContent.match(/player_hide_pause_overlay:\s*{[^}]*component:\s*"switch"/);
26+
expect(pauseOverlayMatch).not.toBeNull();
27+
});
28+
});
29+
30+
describe('CSS Rules', () => {
31+
let playerCssContent;
32+
33+
beforeAll(() => {
34+
const cssPath = path.join(__dirname, '../../js&css/extension/www.youtube.com/appearance/player/player.css');
35+
playerCssContent = fs.readFileSync(cssPath, 'utf8');
36+
});
37+
38+
test('CSS should target .ytp-bezel class', () => {
39+
expect(playerCssContent).toContain('.ytp-bezel');
40+
});
41+
42+
test('CSS should target .ytp-bezel-text-wrapper class', () => {
43+
expect(playerCssContent).toContain('.ytp-bezel-text-wrapper');
44+
});
45+
46+
test('CSS should use it-player-hide-pause-overlay attribute', () => {
47+
expect(playerCssContent).toContain("it-player-hide-pause-overlay='true'");
48+
});
49+
50+
test('CSS should hide pause overlay with display:none', () => {
51+
expect(playerCssContent).toContain('display: none !important');
52+
});
53+
});
54+
55+
describe('Translations', () => {
56+
let messagesContent;
57+
58+
beforeAll(() => {
59+
const messagesPath = path.join(__dirname, '../../_locales/en/messages.json');
60+
messagesContent = fs.readFileSync(messagesPath, 'utf8');
61+
});
62+
63+
test('hidePauseOverlay translation key should exist', () => {
64+
expect(messagesContent).toContain('"hidePauseOverlay"');
65+
});
66+
67+
test('hidePauseOverlay should have a message', () => {
68+
const messages = JSON.parse(messagesContent);
69+
expect(messages.hidePauseOverlay).toBeDefined();
70+
expect(messages.hidePauseOverlay.message).toBeDefined();
71+
});
72+
});
73+
});

0 commit comments

Comments
 (0)