intro-skipper icon indicating copy to clipboard operation
intro-skipper copied to clipboard

automatic skip only for Apps without Skip Button

Open jumoog opened this issue 1 year ago • 7 comments

#206

jumoog avatar Jul 03 '24 19:07 jumoog

Eh. The auto skip option is the only way to have this plugin work with Jellyfin for Kodi.

JinglingB avatar Jul 03 '24 20:07 JinglingB

Eh. The auto skip option is the only way to have this plugin work with Jellyfin for Kodi.

~~whats the ClientName?~~ Already found it

jumoog avatar Jul 03 '24 21:07 jumoog

Thanks. Sorry, I was modifying a plugin to dump the SessionInfo for something played by my Android TV device running Kodi.

I note that DeviceName is what I renamed my Kodi instance running on said device to via the Jellyfin admin web interface. Would looking at session.Client, which still reports "Kodi", be possible instead?

e: Thanks!

JinglingB avatar Jul 03 '24 21:07 JinglingB

Why not future proof it? Android TV and Kodi can be your defaults and allow entry of user defined values. This also allows you to add new values in the future by simply updating a list.

AbandonedCart avatar Jul 04 '24 00:07 AbandonedCart

Good idea. I would go one step further and let the user choose the client from his known clients list.

jumoog avatar Jul 04 '24 07:07 jumoog

PoC:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Drag and Drop Multiple Items</title>
    <style>
        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            margin-top: 50px;
        }
        ul {
            list-style-type: none;
            padding: 0;
            width: 200px;
            height: 300px;
            border: 1px solid #ccc;
            overflow-y: auto;
        }
        li {
            padding: 10px;
            cursor: pointer;
            border-bottom: 1px solid #ccc;
            user-select: none;
        }
        li:hover {
            background-color: #f0f0f0;
        }
        li.selected {
            background-color: #d0e0ff;
        }
    </style>
</head>
<body>

<div class="container">
    <ul id="leftList">
        <li draggable="true">Jellyfin Web</li>
        <li draggable="true">Jellyfin Android</li>
        <li draggable="true">Findroid</li>
        <li draggable="true">Jellyfin Media Player</li>
    </ul>
    <ul id="rightList">
        <li draggable="true">Android TV</li>
        <li draggable="true">Kodi</li>
    </ul>
</div>

<script>
    document.querySelectorAll('ul').forEach(list => {
        list.addEventListener('click', function(event) {
            if (event.target.tagName === 'LI') {
                event.target.classList.toggle('selected');
            }
        });

        list.addEventListener('dragstart', function(event) {
            if (event.target.tagName === 'LI') {
                const selectedItems = list.querySelectorAll('li.selected');
                if (!selectedItems.length) {
                    event.target.classList.add('selected');
                }
                event.dataTransfer.setData('text/plain', null);
            }
        });

        list.addEventListener('dragover', function(event) {
            event.preventDefault();
        });

        list.addEventListener('drop', function(event) {
            event.preventDefault();
            const selectedItems = document.querySelectorAll('.selected');
            selectedItems.forEach(item => {
                list.appendChild(item);
                item.classList.remove('selected');
            });
        });
    });

    document.querySelectorAll('li').forEach(item => {
        item.setAttribute('draggable', 'true');
    });
</script>

</body>
</html>

jumoog avatar Jul 05 '24 09:07 jumoog

Findroid uses the plugin API and displays a native button. (To avoid confusion later)

AbandonedCart avatar Jul 05 '24 22:07 AbandonedCart

Add the option to auto skip when the player isn't currently active, for example when the user watch through pip. Is that even possible to detect?

dredstone1 avatar Aug 25 '24 19:08 dredstone1

It depends on the situation. In a native app, pip is handled by the app. On a website, it's handled by the browser. The browser would expose that information to JavaScript. The app may not.

https://stackoverflow.com/questions/61507068/checking-whether-or-not-a-video-is-picture-in-picture-mode

AbandonedCart avatar Aug 25 '24 19:08 AbandonedCart

The app version don't support pip, and from what you sent the web client can detect it, so it something that you can do?

dredstone1 avatar Aug 26 '24 14:08 dredstone1

The app version don't support pip, and from what you sent the web client can detect it, so it something that you can do?

#208 (this) is the PR for the feature. It’s still a draft. It will depend on whether jumoog wants to add Browser (PiP) as an option here or leave that to be a separate option.

AbandonedCart avatar Aug 26 '24 14:08 AbandonedCart

OK I will add issue. And maybe in the future I will code it myself

dredstone1 avatar Aug 26 '24 17:08 dredstone1

OK I will add issue. And maybe in the future I will code it myself

The point of that was actually to be patient.

AbandonedCart avatar Aug 26 '24 18:08 AbandonedCart

Why not future proof it? Android TV and Kodi can be your defaults and allow entry of user defined values. This also allows you to add new values in the future by simply updating a list.

will do this in another PR. Im not in the mood for frontend today 😆

jumoog avatar Aug 31 '24 16:08 jumoog

The frontend will no doubt attract more posts about possible selections anyway, so keeping them separate will make it more manageable.

AbandonedCart avatar Aug 31 '24 16:08 AbandonedCart