clappr/clappr-plugins

dvr-controls doesn't correctly apply sometimes

Opened this issue · 0 comments

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.