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

dvr-controls doesn't correctly apply sometimes #40

Open
moszkowski97 opened this issue Aug 16, 2021 · 0 comments
Open

dvr-controls doesn't correctly apply sometimes #40

moszkowski97 opened this issue Aug 16, 2021 · 0 comments

Comments

@moszkowski97
Copy link

When I start my dvr enabled stream (X-PLAYLIST-TYPE: EVENT tag), sometimes after the player is fully loaded, the media-controls are missing dvr-controls (also missing "live" and "dvr" tags on the container).

Weirdly enough, if you refresh the page, when I recently started the stream, the amount of times the bug appears is like 80%. And after the stream is getting bigger and bigger playlist size (the max playlist size is 240 minutes), the bug appears less often (after an hour, its like 1/8th of the time).

I'm not so sure what it's causing this bug but I will try to explain my conditions the best way possible.
I use latest version from a cdn, and I build the player from script as usual:

    var player = new Clappr.Player({

        source: "<?php echo getMediaLink();?>stream_high.m3u8",
        parentId: "#player",
        width: '100%',
        height: '100%',
        plugins: [ClapprMarkersPlugin],
        markersPlugin: {
            markers: [
            ],
            tooltipBottomMargin: 17 // optional
        }
    });
    player.getPlugin('click_to_pause').disable();
    player.play();

(bug still apears with no extra plugins)

And this is what it looks like when dvr controls don't load properly (and never do after, even when seeking):

screenshot 1

(the image is live content, I seeked back, but if I didn't it would be the same but with the current time on the right, blue seek bar, and nothing stating that its live content)

If you run player.getPlugin('dvr_controls').settingsUpdate(); the dvr-controls appear again, the container correctly tags "live" and "dvr" and the plugin starts to work as intended again.

screenshot 3

Why is it not loading correctly sometimes? Could it be a core problem when the pluging is loading? I'm trying to slowly read more code from these plugins to figure it out. I will try my best to help out.
As a temporary fix I'm using setTimeout(function(){ player.getPlugin('dvr_controls').settingsUpdate(); }, 1000); and most users shouldn't even notice it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant