Skip to content

Commit bec4ad3

Browse files
committed
Updates
1 parent fba0ec3 commit bec4ad3

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

index.user.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// @name agefans Enhance
33
// @namespace https://github.com/IronKinoko/agefans-enhance
44
// @icon https://www.age.tv/favicon.ico
5-
// @version 1.53.0
5+
// @version 1.53.1
66
// @description 增强播放功能,实现自动换集、无缝换集、画中画、历史记录、断点续播、弹幕等功能。适配agefans、NT动漫、bimiacg、mutefun、次元城、稀饭动漫
77
// @author IronKinoko
88
// @include https://www.age.tv/*
@@ -2642,7 +2642,7 @@
26422642
content: `
26432643
<table class="k-table">
26442644
<tbody>
2645-
<tr><td>\u811A\u672C\u7248\u672C</td><td>${"1.53.0"}</td></tr>
2645+
<tr><td>\u811A\u672C\u7248\u672C</td><td>${"1.53.1"}</td></tr>
26462646
<tr>
26472647
<td>\u811A\u672C\u4F5C\u8005</td>
26482648
<td><a target="_blank" rel="noreferrer" href="https://github.com/IronKinoko">IronKinoko</a></td>
@@ -2768,7 +2768,7 @@ ${src}
27682768
27692769
# \u73AF\u5883
27702770
userAgent: ${navigator.userAgent}
2771-
\u811A\u672C\u7248\u672C: ${"1.53.0"}
2771+
\u811A\u672C\u7248\u672C: ${"1.53.1"}
27722772
`;
27732773

27742774
const GlobalKey = "show-help-info";
@@ -3620,16 +3620,17 @@ ${text}
36203620
this.on("next", () => {
36213621
this.message.info("\u6B63\u5728\u5207\u6362\u4E0B\u4E00\u96C6");
36223622
});
3623-
let fullscreenIsActivedBeforeEnter = this.fixFullscreen();
3623+
const tryFixExitFullscreenOnInit = this.fixFullscreen();
3624+
window.addEventListener("resize", () => {
3625+
tryFixExitFullscreenOnInit();
3626+
});
36243627
this.on("enterfullscreen", () => {
36253628
this.$videoWrapper.addClass("k-player-fullscreen");
3626-
if (fullscreenIsActivedBeforeEnter) {
3627-
this.plyr.fullscreen.exit();
3628-
fullscreenIsActivedBeforeEnter = false;
3629-
}
3629+
tryFixExitFullscreenOnInit();
36303630
});
36313631
this.on("exitfullscreen", () => {
36323632
this.$videoWrapper.removeClass("k-player-fullscreen");
3633+
tryFixExitFullscreenOnInit();
36333634
});
36343635
this.on("volumechange", () => {
36353636
this.configSaveToLocal("volume", this.plyr.volume);
@@ -3782,12 +3783,26 @@ ${text}
37823783
});
37833784
}
37843785
fixFullscreen() {
3785-
const isActive = screen.width === this.$wrapper.width() && screen.height === this.$wrapper.height();
3786+
let isActive = screen.width === this.$wrapper.width() && screen.height === this.$wrapper.height();
37863787
if (isActive) {
37873788
$('[data-plyr="fullscreen"]').addClass("plyr__control--pressed");
37883789
this.$videoWrapper.addClass("k-player-fullscreen");
37893790
}
3790-
return isActive;
3791+
return () => {
3792+
if (!isActive)
3793+
return;
3794+
isActive = false;
3795+
$('[data-plyr="fullscreen"]').removeClass("plyr__control--pressed");
3796+
this.$videoWrapper.removeClass("k-player-fullscreen");
3797+
try {
3798+
this.plyr.fullscreen.exit();
3799+
} catch (error) {
3800+
}
3801+
};
3802+
}
3803+
fixExitFullscreen() {
3804+
$('[data-plyr="fullscreen"]').removeClass("plyr__control--pressed");
3805+
this.$videoWrapper.removeClass("k-player-fullscreen");
37913806
}
37923807
async injectSearchActions() {
37933808
this.$searchActions = createSearchActionsHTML().toggle(

0 commit comments

Comments
 (0)