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

BitRate value displays 0 on Safari 11.0.2 for visualQuality


Hi JWPlayer team,

I need to keep tracking the resolution of the HLS video visualQuality while playing the video.
I started using BitRate value of the "visualQuality" data object. It works fine on Chrome/FireFox/IE which displayed the correct BitRate value (different from 0) for high resolution and low resolution video.
But It always displays "0" BitRate value on Safari for high resolution and low resolution.

What is a reliable value that JWPlay support for tracking the video resolution ? Could you please figure this out why Safari does not display the BitRate data ?

Thank you
Nhat Nguyen

10 Community Answers

Todd

JW Player Support Agent  
1 rated :

Safari has built-in support for HLS playback, so our player simply passes the <video> tag over to Safari and they play the video. This is why we do not have all the reporting or metadata available in the player.

One thing you can try is setting hlsjsdefault: true as this will force the player to use our built-in provider in Safari. Please see https://developer.jwplayer.com/jw-player/docs/developer-guide/customization/configuration-reference/ for more details.

Nhat Nguyen

User  
0 rated :

Hi Todd,

Thank you for your quick response.
I have tried the setting ( hlsjsdefault: true ) but it's still giving me "0" for the BitRate value on Safari.
So, I would try to use another reliable value for tracking the resolution of the video.

Todd

JW Player Support Agent  
0 rated :

What is your test stream URL? I would like to do some testing on my side as well.

Nhat Nguyen

User  
0 rated :

It's just my hls test video on local. You can try any of your HLS video.
But you can take a look at my test result.

TestVideo.m3u8 content:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=987136,NAME=High,CODECS="mp4a.40.2,avc1.77.30"
HIGH/TestVideo.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=454656,NAME=Medium,CODECS="mp4a.40.2,avc1.77.30"
MEDIUM/TestVideo.m3u8
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=321536,NAME=Low,CODECS="mp4a.40.2,avc1.77.30"
LOW/TestVideo.m3u8

// Tracking video resolution changes during playing time
jwplayerInstance.on('visualQuality', function (data) {
console.log(JSON.stringify(data));
});

Result Data on specific web browser::
Google Chrome / Firefox:
{
"reason": "auto",
"mode": "auto",
"type": "visualQuality",
"level": {
"bitrate": 454656,
"index": 1,
"height": 266,
"label": "auto",
"width": 640
}
}

Safari / Egde:
{
"level": {
"width": 1280,
"height": 720,
"index": 0,
"label": "0"
},
"reason": "auto",
"mode": "auto",
"bitrate": 0,
"type": "visualQuality"
}


JWPlayer Config Value:
{
"playlist": [
{
"sources": [
{
"file": "../video/HLS/TestVideo.m3u8"
},
{
"file": "/video/HLS/High/TestVideo.mp4"
}
]
}
],
"hlslabels": {
"287559": "Low",
"533531": "Medium",
"1559812": "High"
},
"flashplayer": "jwplayer/jwplayer.flash.swf",
"width": "100%",
"aspectratio": "16:9",
"primary": "html5",
"preload": "auto",
"hlsjsdefault": true,
"androidhls": true,
"hlshtml": true,
"autostart": false,
"controls": false,
"icons": true
}

Todd

JW Player Support Agent  
0 rated :

I created at test page at http://qa.jwplayer.com/~todd/safari-hlsjs.html and set safarihlsjs: true.

I am seeing the bitrate in the response object for on(‘visualQuality’). Please see my screen shot at https://imgur.com/a/6fQIN

Nhat Nguyen

User  
0 rated :

That's awesome Todd.
I have set "safarihlsjs: true" to the jwplayer config and it works. I am seeing the bitrate in the response object on Safari.
Thank you so much for your helps.

Todd

JW Player Support Agent  
0 rated :

Hi Nhat,

You’re welcome. I will mark this support case as closed, but certainly contact us again if you have any other support questions or concerns.

Kind regards,
Todd

NHAT NGUYEN

User  
0 rated :

Hi Todd,

When I set "safarihlsjs: true", it worked on Safari Mac (desktop or laptop version 11.0.2 + 11.0.3).
But I still have got the same issue that I haven't seen the bitrate in the response object for on(‘visualQuality’) on Safari iPad (iOS version 9.3.5) or Safari iPhone.
Could you please take a look on the iPad or iPhone ? Please let me know if there is anything.

Thank you so much and have a good one.
Nhat

Todd

JW Player Support Agent  
0 rated :

If “safarihlsjs: true” does not work on iOS, then we will not have a way to fix this. It sounds like iOS Safari does not give us this data as the video is playing.

Nhat Nguyen

User  
0 rated :

Thank you for quick response. It sounds like I will need to go another route to track resolutions as the video is playing.

This question has received the maximum number of answers.