Git Product home page Git Product logo

Comments (5)

Archmonger avatar Archmonger commented on May 16, 2024

This is an issue with Plex considering a touch command as two separate presses (mouse up and mouse down), I will look into a JavaScript rate limiting as a potential fix.

from improved-plex-mobile.

TheGuardianWolf avatar TheGuardianWolf commented on May 16, 2024

Ah, was doing some further testing as you wrote that, it occurs in the unmodified version as well.

from improved-plex-mobile.

Archmonger avatar Archmonger commented on May 16, 2024

That is correct, it is native Plex behavior. A work around may be hacky, which is part of the reason I've been procrastinating on it.

from improved-plex-mobile.

TheGuardianWolf avatar TheGuardianWolf commented on May 16, 2024

This does the job for me on my laptop, I'll need to upgrade my userscript to test on mobile.

I tried to make something that would be targeted as possible to reduce side effects, feel free to adapt this to something you like.

Edit: Mobile tested, works fine, leave a message if you implement this so I can remove it from the userscript.

document.getElementById('plex').addEventListener('touchstart', (e) => {
    let resumeButton = document.querySelectorAll('button[data-qa-id="resumeButton"]')[0];
    let pauseButton = document.querySelectorAll('button[data-qa-id="pauseButton"]')[0];

    if (
        resumeButton && resumeButton.contains(e.target) ||
        pauseButton && pauseButton.contains(e.target)
    ) {
        e.preventDefault();
    }
});

from improved-plex-mobile.

Archmonger avatar Archmonger commented on May 16, 2024

Very interesting implementation, I was originally thinking of going the route of global rate limiting for touch events. But this is much more localized and functional. Will add it to plex_mobile.js, much appreciated!

from improved-plex-mobile.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.