clappr / clappr-level-selector-plugin

Clappr Level Selector Plugin
MIT License
76 stars 56 forks source link

wrong switching #46

Closed antonzhelyazkov closed 7 years ago

antonzhelyazkov commented 7 years ago

Hi clappr team,

We have strange problem with level selector. When we start nDVR stream level selector plugin begins switching between 2 profiles in our playlist. If you move scroller backwards and than "back to live" problem disappears. We use Wowza and here is configuration of our smil file:

`<?xml version="1.0" encoding="UTF-8"?>

` Here is our playlist file: #EXTM3U #EXT-X-VERSION:3 #EXT-X-STREAM-INF:BANDWIDTH=714000,NAME="LQ",CODECS="avc1.100.30,mp4a.40.2",RESOLUTION=640x360 chunklist_w165283381_b714000_slbul_t64TFE=.m3u8?h=KxGjlXd2J #EXT-X-STREAM-INF:BANDWIDTH=1496000,NAME="HQ",CODECS="avc1.100.30,mp4a.40.2",RESOLUTION=720x576 chunklist_w165283381_b1496000_slbul_t64SFE=.m3u8?h=KxGjlXd2J I tried to investigate the problem. It seem that clappr gets chunklists for our 2 profiles. When I change the places of our profiles - primary 576p, secondary 360p problem disappears. Could you help me to resolve the problem here is our clappr configuration: `var playerElement = document.getElementById("player"); var player = new Clappr.Player({ source: 'http://xxx.xxx.xxx.xx:80/dvr/test.smil/playlist.m3u8?DVR', baseUrl: '/clappr', autoPlay: true, playbackNotSupportedMessage: "Your browser does not support the playback of this video./n Please try on a different browser or try to install Adobe Flash Player(https://get.adobe.com/flashplayer).", mediacontrol: {seekbar: "#4D6EAC", buttons: "#66B2FF"}, plugins: [LevelSelector], levelSelectorConfig: { title: 'Quality', labels: { 2: "HD", 1: 'High', 0: 'Low', }, labelCallback: function(playbackLevel, customLabel) { return customLabel +'('+ playbackLevel.level.height+'p)'; } }, // hlsLogEnabled : false, // parentId: "#player", // hlsMinimumDvrSize: 0, //startFromLevel: -2, //autoStartMaxDuration : 1000, // flushLiveURLCache : false, useHardwareVideoDecoder: true, // maxBufferLength: 20, // hlsjsConfig: { // maxMaxBufferLength: 30, // maxLoadingDelay : 2 // } , mute: false, height: 360, width: 640 }); player.attachTo(playerElement);`
leandromoreira commented 7 years ago

did you watch the network requests? if yes, did you notice if the browser is really doing requests to different playlists? are you able to reproduce this using other live hls streaming?

antonzhelyazkov commented 7 years ago

Thank you, Here is a test url with problem stream http://players.neterra.tv:8080/clappr/kinonova.html Could you try to start stream? If you start network tab you will see what problem I tried to describe.

antonzhelyazkov commented 7 years ago

it seems that my problem is connected with wrong stream alignment. My streams are not synchronized.

leandromoreira commented 7 years ago

@antonzhelyazkov when you this stream http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8 does it works just fine?

antonzhelyazkov commented 7 years ago

@leandromoreira Hi, It seem that this is server side problem. Could you help me to configure clappr level selector to work only with manual switch between profiles? I want to disable auto switch.

Thank you in advance.

leandromoreira commented 7 years ago

@antonzhelyazkov sure, you'll need to fine tune hls.js as the author (@mangui) have stated :

you just need to do hls.loadLevel=0 before or just after calling hls.loadSource(url) this will start from lowest and stick to it (disable autoswitch).

You can see more about it on API documentation. And it's easy to integrate this configuration with clappr.