videojs / videojs-contrib-quality-levels

Other
154 stars 52 forks source link

qualityLevels with length 0 #91

Closed msjh80311 closed 2 years ago

msjh80311 commented 5 years ago

Description

I've found that issue videojs/videojs-contrib-quality-levels#13 described a similar problem, and the reply told to use eventListener to addqualitylevel. I followed, but it seems like it just didn't get to those lines.

my codes are like:

  qualityLevels.on('addqualitylevel', function(event) {
    let qualityLevel = event.qualityLevel;
    console.log('qualityLevel.height:', qualityLevel.height);  // logs not printed
  });

What's more weird is, this problem doesn't always happen.

Users seldom encounter. And I can only tell that when my document is hidden during the initializing of the player, there's a lot more chance to happen!

Results

Expected

I could get all the tracks(sources) of my video via player.qualityLevels().

Actual

Problems that addqualitylevel seldom not works. player.qualityLevels() is an empty list.

Error output

no error message displayed at all...

Additional Information

versions

videojs

7.5.0+

browsers

desktop chrome, safari

plugins

nikhilpaliwal129 commented 4 years ago

Hi, I am facing a similar issue. i.e. getting the empty array of levels in the "player.qualityLevels()" object in chrome version 72. is there any solution for it

Plugins:

OCharnyshevich commented 3 years ago

Hi, try to use console.log('qualityLevel.height:', event.qualityLevel.height);

gkatsev commented 3 years ago

If someone can provide a reduced test case we can take a look, however, we haven't seen this issue ourselves.