Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

HLS Quality selection from a m3u8 File


Hi All,

I cant seem to find anywhere to set this so thought I would ask.

I have a m3u8 File with Multiple streams, each is a m3u8 file splitting the video into multiple chunks.
Now what I want to do is set a default quality on player initialize.

By this I mean there are the following bit rates (2600,1600,1000,900) and I have labled this with
hlslabels:{
"2600":"720p",
"1600":"480p",
"1000":"360p",
"900":"180p",
}

Now how can i set the player to when starting to use 2600 and not auto by default?

-Digi

4 Community Answers

griffdigi

User  
0 rated :

Wait i found it :P

Adding this after the player config does it :)
playerInstance.onReady(function(){
playerInstance.onQualityLevels(function(event) {
playerInstance.setCurrentQuality(5);
});
});

Alex

JW Player Support Agent  
0 rated :

Glad you got it figured out! However, keep in mind that manually setting the quality of a HLS stream through the API will cause the stream to no longer be able to automatically adapt its quality. It will remain at whatever quality you set it at.

griffdigi

User  
0 rated :

Hi Alex,

I left the buttong for the stream selection, would the selection of Auto in this then not adjust automatically?
Basically its just forcing the highest quality and if my viewer wishes for a lower quality they can select it manually.

Alex

JW Player Support Agent  
0 rated :

If you use .setCurrentQuality() to play the highest quality, then the player will play that quality and will not adapt automatically to a change in network conditions. If the viewer then hovers over the HD button and chooses “Auto” the stream will then be able to adapt its quality automatically.

This question has received the maximum number of answers.