|
2 | 2 | // @name agefans Enhance |
3 | 3 | // @namespace https://github.com/IronKinoko/agefans-enhance |
4 | 4 | // @icon https://www.age.tv/favicon.ico |
5 | | -// @version 1.53.0 |
| 5 | +// @version 1.53.1 |
6 | 6 | // @description 增强播放功能,实现自动换集、无缝换集、画中画、历史记录、断点续播、弹幕等功能。适配agefans、NT动漫、bimiacg、mutefun、次元城、稀饭动漫 |
7 | 7 | // @author IronKinoko |
8 | 8 | // @include https://www.age.tv/* |
|
2642 | 2642 | content: ` |
2643 | 2643 | <table class="k-table"> |
2644 | 2644 | <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> |
2646 | 2646 | <tr> |
2647 | 2647 | <td>\u811A\u672C\u4F5C\u8005</td> |
2648 | 2648 | <td><a target="_blank" rel="noreferrer" href="https://github.com/IronKinoko">IronKinoko</a></td> |
@@ -2768,7 +2768,7 @@ ${src} |
2768 | 2768 |
|
2769 | 2769 | # \u73AF\u5883 |
2770 | 2770 | userAgent: ${navigator.userAgent} |
2771 | | -\u811A\u672C\u7248\u672C: ${"1.53.0"} |
| 2771 | +\u811A\u672C\u7248\u672C: ${"1.53.1"} |
2772 | 2772 | `; |
2773 | 2773 |
|
2774 | 2774 | const GlobalKey = "show-help-info"; |
@@ -3620,16 +3620,17 @@ ${text} |
3620 | 3620 | this.on("next", () => { |
3621 | 3621 | this.message.info("\u6B63\u5728\u5207\u6362\u4E0B\u4E00\u96C6"); |
3622 | 3622 | }); |
3623 | | - let fullscreenIsActivedBeforeEnter = this.fixFullscreen(); |
| 3623 | + const tryFixExitFullscreenOnInit = this.fixFullscreen(); |
| 3624 | + window.addEventListener("resize", () => { |
| 3625 | + tryFixExitFullscreenOnInit(); |
| 3626 | + }); |
3624 | 3627 | this.on("enterfullscreen", () => { |
3625 | 3628 | this.$videoWrapper.addClass("k-player-fullscreen"); |
3626 | | - if (fullscreenIsActivedBeforeEnter) { |
3627 | | - this.plyr.fullscreen.exit(); |
3628 | | - fullscreenIsActivedBeforeEnter = false; |
3629 | | - } |
| 3629 | + tryFixExitFullscreenOnInit(); |
3630 | 3630 | }); |
3631 | 3631 | this.on("exitfullscreen", () => { |
3632 | 3632 | this.$videoWrapper.removeClass("k-player-fullscreen"); |
| 3633 | + tryFixExitFullscreenOnInit(); |
3633 | 3634 | }); |
3634 | 3635 | this.on("volumechange", () => { |
3635 | 3636 | this.configSaveToLocal("volume", this.plyr.volume); |
@@ -3782,12 +3783,26 @@ ${text} |
3782 | 3783 | }); |
3783 | 3784 | } |
3784 | 3785 | 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(); |
3786 | 3787 | if (isActive) { |
3787 | 3788 | $('[data-plyr="fullscreen"]').addClass("plyr__control--pressed"); |
3788 | 3789 | this.$videoWrapper.addClass("k-player-fullscreen"); |
3789 | 3790 | } |
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"); |
3791 | 3806 | } |
3792 | 3807 | async injectSearchActions() { |
3793 | 3808 | this.$searchActions = createSearchActionsHTML().toggle( |
|
0 commit comments