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

Quality API on JWPlayer 6


Hi everybody,

I've been working with JWPlayer for days developing a simple analytics plugin for the newer 6 version.

The plugin logic relies on player events which is enough for us.
All is working pretty good as expected.
But the issue comes when I try to get the current bitrate of the video asset that is playing.
As I've seen in many threads on this forum that is possible using the Javascript API (this is mandatory because we want the plugin run on web browsers and mobile devices).
So in Quality API section I see available:
bc.. jwplayer().getQualityLevels() -> array of level objects
jwplayer().getCurrentQuality() -> current selected level of the array


And as the documentation says I should retrieve the bitrate from the level object like:
bc.. var levels = jwplayer().getQualityLevels();
var currentBitrate = levels[jwplayer().getCurrentQuality()].bitrate;


But unfortunatelly I get the current index, the array of levels but inside every level object I'm only able to see the attribute
bc.. label


No bitrate or other metadata seems to be returned.

I've also tried to force Flash player to load with
bc.. primary: "flash"


on the player setup but the same results are shown.

So I wonder how to get the current video bitrate for sending to our analytics account using a plugin.
Is this related with the video encoding?
In which situations I will recieve the bitrate on the level object?
Is there any other workaround for calculating the average bitrate (or near value) for the current playback?

Thanks,
Adrian.

6 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you show us where you are running this?

JW Player

User  
0 rated :

Hi Ethan,

Thanks for your time.
You can test a simple player on the following url: http://95.211.106.14/plugins/private/v6/

If you open the developer tools (or firebug) and go to network you will see all the requests.
The one that sends the bitrate as a param is the "ping" request.
As you will see, always is a 0 value.

The plugin is hosted on the same site, under the url: http://95.211.106.14/plugins/private/v6/js/Nice264AnalyticsPlugin.js

Again thanks for your help.

Ethan Feldman

JW Player Support Agent  
0 rated :

I see the player running and I see the pings.

We have a demo of our quality API here which might help you though – http://developer.longtailvideo.com/player/tags/mediaplayer-6.0/test/api-quality.html

JW Player

User  
0 rated :

Hi again Ethan,

I've been testing and looking the sample page for the quality api.
Two things I'm confused.

1. In your example, there is no "bitrate" on the quality object but yes a "label", "height" and "width" fields. Why? Is not possible to access bitrate on all videos that are currently playing back?

2. If I copy paste the playlist to my player setup page, I'm not able to get "label", "height" and "width" attributes on each level. Why if they are the same videos?
You can have a look at http://pilottest.plugins.nice264.com/test/jwplayer6/index_quality.html
The console output for the firebug is logging the current quality index, the quality levels array, the label attribute and the bitrate attribute.

Thanks,
Adrian.

JW Player

User  
0 rated :

Just for more info, I have a Live video that is getting the "bitrate" correctly (is a licensed player...it matters?) but if I enter fullscreen mode then the bitrate is sended as "undefined".
If I exit fullscreen again the bitrate is sent correctly.

Can explain this behaviour? What does the player do when entering in fullscreen?

Thanks,
Adrian.

Ethan Feldman

JW Player Support Agent  
0 rated :

1) This because it is progressive download I believe.
2) Actually, you should do it like this then – http://www.longtailvideo.com/support/jw-player/29248/sd-and-hd-qualities
3) For fullscreen, you should use the API to check for that – http://www.longtailvideo.com/support/jw-player/28851/javascript-api-reference

This question has received the maximum number of answers.