Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small client freeze when "skip intro" button is used #405

Closed
tilda opened this issue Mar 18, 2023 · 36 comments · Fixed by #456
Closed

Small client freeze when "skip intro" button is used #405

tilda opened this issue Mar 18, 2023 · 36 comments · Fixed by #456
Labels
bug Something isn't working

Comments

@tilda
Copy link

tilda commented Mar 18, 2023

Describe the bug
When using the "Skip Intro" functionality as part of said plugin, my client freezes for around 10-20 seconds. I've had this happen consistently over multiple series. This didn't happen before 1.9.0.

To Reproduce

  1. Have "Skip Intro" enabled (of course on the server as well)
  2. Start watching an episode until the button shows up
  3. Click the button, and watch the client freeze up for a bit

Expected behavior
For the client to skip to the end of the intro without any freezes.

Screenshots
N/A.

Desktop (please complete the following information):

  • OS: Windows 11
  • Version: 1.9.0
  • Installation Method: Official build, Windows installer.

Additional context
Closing the client while frozen gets audio playing for a couple seconds (but then closes the client, like it should).

@tilda tilda added the bug Something isn't working label Mar 18, 2023
@kstorbakken
Copy link

kstorbakken commented Mar 18, 2023

I'm having this issue with 1.9.0 as well with the skip intro button, it's not happening on 1.8.9. I'm using Linux Mint 21.1 and tried both the deb package and flatpak with same results. I do have additional lockups as well when pausing and trying to exit videos and such, it's very random. Sometimes it will happen, then it'll work the next time, then back to freezing. The freezing lasts about 30s then does the action selected.

@h1ght
Copy link

h1ght commented Mar 18, 2023

same on windows 10 22h2, prior to 1.9 it was working fine. now at my client just freezes, when closing the app sounds plays for some secs before its closed. tried to delete cache in appdata, issue still exist.

@iwalton3
Copy link
Member

Does this happen just when skip intro is enabled or always?

@iwalton3
Copy link
Member

If this is somehow caused by the MPV version change, this build will fix it: https://github.com/jellyfin/jellyfin-media-player/actions/runs/4457781601

@tilda
Copy link
Author

tilda commented Mar 19, 2023

Does this happen just when skip intro is enabled or always?

This only happens when the plugin's function is used, so yes only when enabled. (I don't have patched frontend installed on the server so cannot test with that.)

Will try the other build later and see what that does.

@iwalton3
Copy link
Member

I think the plugin does some strange stuff with MutationObserver so it could just be that.

@h1ght
Copy link

h1ght commented Mar 24, 2023

i tr

If this is somehow caused by the MPV version change, this build will fix it: https://github.com/jellyfin/jellyfin-media-player/actions/runs/4457781601

i tried this build, works fine for windows, but its much slower compared to previous version.

@iwalton3
Copy link
Member

Yeah I don't think that build is a fix. This is something I will have to dig into but I did notice UI component lagging myself at some point. It'll probably be a git bisect thing to be honest

@h1ght
Copy link

h1ght commented Mar 27, 2023

what u mean by lagging? like dragging the window on the screen? that was jerky before for me. not that fluent like other windows

@Wastfulajr
Copy link

I've had the same issue with certain media, clicking "Skip Intro" freezes up the client for 1-2 minutes before continuing. While it buffers, the app itself hangs temporarily while attempting to close.

@TheStachelfisch
Copy link

I also observed, that with some media the freeze is either longer or shorter. Sometimes it's only a few seconds while sometimes it's multiple minutes and often it never unfreezes.

@Wastfulajr
Copy link

I also observed, that with some media the freeze is either longer or shorter. Sometimes it's only a few seconds while sometimes it's multiple minutes and often it never unfreezes.

I experienced the same thing, with some media it's incredibly snappy, but with other types it lags.

I also didn't immediately see any relation with a specific format, as I tried it with differing resolutions, transcoding, and formats.

@h1ght
Copy link

h1ght commented Apr 14, 2023

@Wastfulajr @TheStachelfisch are u using the linked build? #405 (comment)

@TheStachelfisch
Copy link

@Wastfulajr @TheStachelfisch are u using the linked build? #405 (comment)

Yes

@Kunal926

This comment was marked as spam.

@veerpandya
Copy link

Just wanted to add, this issue is still occurring on 1.9.1. For me on mac playing mkv files it's not just a small freeze, I have to quit out and restart the app to continue playback.

@Wastfulajr
Copy link

I'm also still having this issue on build 1.9.1. Same as before it occasionally skips forward to the correct frame and then freezes requiring a restart, and occasionally unfreezes and continues after 1-2 minutes.

@SerbNerd
Copy link

I am on build 1.9.1 and more often than not my whole client is frozen once I click the skip intro button, requiring me to close the whole player. Interestingly enough, it starts playing after the intro when I relaunch the media.

Side note: I have noticed my GPU go up in usage a bit when the lag occurs. Not sure if it's helpful but it almost looks like its trying to transcode something even though the video is direct playing.

@jacob1264
Copy link

Intro skipper was freezing my media player client, setting the cache from default to large or very large seemed to mostly fixed it. It stutters for a couple seconds but does not freeze

@ohitstom
Copy link

ohitstom commented Jun 1, 2023

I am on build 1.9.1 and more often than not my whole client is frozen once I click the skip intro button, requiring me to close the whole player. Interestingly enough, it starts playing after the intro when I relaunch the media.

Side note: I have noticed my GPU go up in usage a bit when the lag occurs. Not sure if it's helpful but it almost looks like its trying to transcode something even though the video is direct playing.

Exactly the same issue here, nvidia gpu using local playback.

@DestinyofYeet
Copy link

DestinyofYeet commented Jun 6, 2023

It fixed it for me by re-replacing the web folder with the dist folder as described here after a jellyfin server update.

Never mind, it seemed to fix it, but after leaving the player open for a while and coming back, the issue unfortunately persists.

@jacob1264
Copy link

I have tried many fixes, none of them seem to work flawlessly. I disabled the intro skipper plugin in the desktop client and it solved 90% of the issues. The desktop player just used the server's version. Enabling both the server version and the desktop plugin causes it to freeze a lot more.

Line 121 - C:\Program Files\Jellyfin\Jellyfin Media Player\web-client\extension\skipIntroPlugin.js
await injectSkipIntroHtml(); // I have trust issues

I tried to figure it out but I don't know how to properly debug Jellyfin.

@TheFeelTrain
Copy link
Contributor

TheFeelTrain commented Jun 9, 2023

My server doesn't have the intro skipper web client but I still get the freeze, so I don't think that is related. Although it could be another bug causing a similar thing. I am also 95% sure it used to work fine in 1.8.x so it was almost certainly something that changed in 1.9.x that is the cause because it did work properly at one point. Which also means it's probably unrelated to anything server-side in general.

Edit: Changing the cache size from large to vlarge actually seems to have pretty much fix it as far as I can tell. I tried out several different episodes and it worked on all of them, albeit with a roughly half-second pause before skipping.

@jacob1264
Copy link

I thought changing the cache size fixed it for me but it just masked it. You may find Intro Skip will freeze again after a few episodes, especially episodes with larger filesizes.

After your report I am 80% confident that the bug lies within the Skip Intro plugin itself within the desktop client. And maybe 20% in our environments, I am not running proper tests but in my latest experiment I have found:

With the plugin disabled:
Only using the injected web plugin, I have had zero freezes and no lag after playing several hours of content and manually clicking skip intros. The skip intro function is instant.

With the desktop skip intro plugin enabled:
Skip intros lag for a second at first, as episodes are play the lag seems to get worse.
After a few episodes have played, clicking the Skip Intro button almost guarantees to cause the program to hang or freeze for a long time.

I don't really see a need to use the desktop plugin, I can't find a downside using the server side version.

@ashu54-aseem
Copy link

ashu54-aseem commented Jun 12, 2023

I have been experiencing this bug for some time now. Here are my observations:

It gets worse on subsequent playbacks in a session, regardless of whether or not the button is used.
There are no issues with other clients or jellyfin-web, so I think this is a client-specific issue.
On terminating the app after it has frozen, playback resumes after the intro, so the intro is skipped successfully.
On waiting out after the playback/player has frozen, it sometimes resumes the playback after 5/10 minutes.
On forcing web interface, the skipping is considerably faster, but from 3rd or 4th playback, there is still a little (around 5-10 seconds) of freezing present.

@dmandrone
Copy link

To clarify, is this still being addressed?

Saw that the commit to solve this issue was deleted, so wanted to be sure.

@TheStachelfisch
Copy link

To clarify, is this still being addressed?

Saw that the commit to solve this issue was deleted, so wanted to be sure.

It still shows up for me. Doesn't seem to be deleted in any way

@dmandrone
Copy link

To clarify, is this still being addressed?
Saw that the commit to solve this issue was deleted, so wanted to be sure.

It still shows up for me. Doesn't seem to be deleted in any way

I completely misread the notes. The testing branch was deleted. Apologies.

But on this topic, this issue still seems to persist, at least on my end.

To avoid myself saying anything else dumb in confusion, the fix is completed but pending release, correct?

@iwalton3
Copy link
Member

Correct nothing has been released yet. Probably will wait for another maintenance release unless something major comes up.

@TheStachelfisch
Copy link

To clarify, is this still being addressed?
Saw that the commit to solve this issue was deleted, so wanted to be sure.

It still shows up for me. Doesn't seem to be deleted in any way

I completely misread the notes. The testing branch was deleted. Apologies.

But on this topic, this issue still seems to persist, at least on my end.

To avoid myself saying anything else dumb in confusion, the fix is completed but pending release, correct?

If you want to use it right now you would need to either build the app yourself or fork the repo and run a Github action to build it, since I don't think an action ran, when the PR was merged

@iwalton3
Copy link
Member

Well that I can just do. https://github.com/jellyfin/jellyfin-media-player/actions/runs/5373776249

@funkey7dan
Copy link

This same issue still happens to me on 1.9.1 - not every use, but usually after skipping intro once, happens on the next episode

@Alexk2309
Copy link

The issue still happens im usually still getting freezes using 1.9.1, well the skipping experience is not as smooth as using the web version of jellyfin.

@menixator
Copy link

For any nix users looking at this issue, here's an overlay. Sadly, it'll actually build it on your system even though the skipIntroPlugin.js lives independently.

{ pkgs, ... }: {

  # Fixes an issue with jmp where clicking the skip intro makes the player freeze
  # https://github.com/jellyfin/jellyfin-media-player/issues/405#issuecomment-1606572053
  nixpkgs.overlays = [
    (final: prev: {
      jellyfin-media-player = prev.jellyfin-media-player.overrideAttrs (finalAttrs: prevAttrs: {
        patches = (prevAttrs.patches or [ ]) ++ [

          (final.pkgs.writeText
            "jellyfin-media-player-skip-intro.patch"
            /*diff*/
            ''
              --- a/native/skipIntroPlugin.js	1970-01-01 05:00:01.000000000 +0500
              +++ b/native/skipIntroPlugin.js	2024-01-16 10:34:09.215694918 +0500
              @@ -84,6 +84,13 @@
                               });
                           }
 
              +            function handleClick(e) {
              +                e.preventDefault();
              +                e.stopPropagation();
              +                skipIntro();
              +                document.querySelector('.skipIntro .btnSkipIntro').removeEventListener('click', handleClick, { useCapture: true });
              +            }
              +
                           async function injectSkipIntroHtml() {
                               const playerContainer = await waitForElement('.upNextContainer', 5000);
                               // inject only if it doesn't exist
              @@ -91,11 +98,7 @@
                                   playerContainer.insertAdjacentHTML('afterend', skipIntroHtml);
                               }
 
              -                document.querySelector('.skipIntro .btnSkipIntro').addEventListener('click', (e) => {
              -                    e.preventDefault();
              -                    e.stopPropagation();
              -                    skipIntro();
              -                }, { useCapture: true });
              +                document.querySelector('.skipIntro .btnSkipIntro').addEventListener('click', handleClick, { useCapture: true });
 
                               if (window.PointerEvent) {
                                   document.querySelector('.skipIntro .btnSkipIntro').addEventListener('pointerdown', (e) => {
            ''
          )
        ];
      });
    })

  ];


}

@viggy96
Copy link
Contributor

viggy96 commented Mar 19, 2024

Correct nothing has been released yet. Probably will wait for another maintenance release unless something major comes up.

When is the next maintenance release of JMP scheduled?

@ashu54-aseem
Copy link

Hey @iwalton3, can you rerun the build action in the meanwhile? Seems like the artifacts have expired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.