videojs-hls-quality-selector icon indicating copy to clipboard operation
videojs-hls-quality-selector copied to clipboard

When `Representation.height` is undefined, menu shows `undefinedp` and this plugin will not work.

Open TW1943 opened this issue 5 years ago • 8 comments

As in the README of videojs-contrib-quality-levels says, All properties are required except width and height. Ref: https://github.com/videojs/videojs-contrib-quality-levels#populating-the-list

So when Representation.height is undefined, selector menu shows only one undefinedp item. (which should be multiple items like 1080p / 720p / etc)

Representation {
  id: string,
  width: number,    // may be undefined
  height: number,    // may be undefined
  bitrate: number,
  enabled: function
}

Suggestion: when height is undefined, maybe use bitrate as key?

TW1943 avatar Mar 11 '19 21:03 TW1943

Ran into the same problem.

Half-baked fix at https://github.com/FEichinger/videojs-hls-quality-selector/tree/add-bitrate-detection (based on @phoban01 adding support for options). Possibly finishing that up in the next couple of days.

vad-systems avatar Sep 10 '19 19:09 vad-systems

I am running into the same issue . Seeing the two qualities : auto and undefined p ? I have no idea how i ran into this. Can anybody help me?

hemantachhami19 avatar Nov 05 '19 15:11 hemantachhami19

@hemantachhami19 it happens if your m3u8 playlist file does not have the resolution defined in the #EXT-X-STREAM-INF lines. You need to change your encoding settings to add the resolution to those lines in the playlist.

scottmx81 avatar Jan 07 '20 16:01 scottmx81

A bitrate key could also be nice if you want multiple bitrates at same resolution

GBeauregard avatar May 04 '20 02:05 GBeauregard

@hemantachhami19 it happens if your m3u8 playlist file does not have the resolution defined in the #EXT-X-STREAM-INF lines. You need to change your encoding settings to add the resolution to those lines in the playlist.

I had this line but also not working

ashadnasim52 avatar Nov 20 '20 17:11 ashadnasim52

in my case the undefinedp comes from the source stream which is of unknown size and bandwidth, i wish to replace undefinedp with 'source' somehow.

Devidian avatar Aug 10 '21 20:08 Devidian

Reading the documentation on this, I was able to remove the audio only version of my m3u8 stream via:

let qualityLevels = player.qualityLevels();
qualityLevels.on('addqualitylevel', function (event) {
	let qualityLevel = event.qualityLevel;
	if (qualityLevel.height) {
		qualityLevel.enabled = true;
	} else {
		qualityLevels.removeQualityLevel(qualityLevel);
		qualityLevel.enabled = false;
	}
});

kylekirkby avatar Aug 23 '21 13:08 kylekirkby

Reading the documentation on this, I was able to remove the audio only version of my m3u8 stream via:

let qualityLevels = player.qualityLevels();
qualityLevels.on('addqualitylevel', function (event) {
	let qualityLevel = event.qualityLevel;
	if (qualityLevel.height) {
		qualityLevel.enabled = true;
	} else {
		qualityLevels.removeQualityLevel(qualityLevel);
		qualityLevel.enabled = false;
	}
});

I passed through the same and it's solution completely saved me. THANK YOU! 💕💕

LucasNeevs avatar Aug 11 '22 14:08 LucasNeevs