videojs / videojs-contrib-quality-levels

Other
154 stars 52 forks source link

Quality Levels Not Populated in Safari for Playlist with multiple formats #127

Closed jgcaruso closed 3 years ago

jgcaruso commented 3 years ago

Description

When using native HLS in Safari, the qualityLevels() collection never gets populated. Doing some debugging, it appears that a lot of the internal methods that populate this collection never gets called.

Disabling native hls allows the qualityLevels to get populated

html5: {
    vhs: {
        overrideNative: true,
    },
    nativeAudioTracks: false,
    nativeVideoTracks: false,
},

Steps to reproduce

Explain in detail the exact steps necessary to reproduce the issue.

  1. Load a player with the videojs-contrib-quality-levels plugin enabled and an adaptive streaming playlist set as the source
  2. Check the player's .qualityLevels() property, it will be empty.

Results

Expected

The qualityLevels() should return an array of the different Representations.

Actual

qualityLevels() returns an empty array.

versions

videojs

7.11.8

browsers

Safari

OSes

MacOS

plugins

videojs-contrib-quality-levels v2.1.0

gkatsev commented 3 years ago

By default, Safari uses the native playback engine. Safari doesn't provide the ability to switch renditions. If you need to use quality-levels on Safari, you'll need to overrideNative, though, I would recommend running HLS natively on Safari. We don't test our playback engine on Safari on a regular basis.

jgcaruso commented 3 years ago

By default, Safari uses the native playback engine. Safari doesn't provide the ability to switch renditions. If you need to use quality-levels on Safari, you'll need to overrideNative,

Thanks for that confirmation. I was thinking about it more and it started to make sense why it wasn't working.

though, I would recommend running HLS natively on Safari. We don't test our playback engine on Safari on a regular basis.

Is this just a matter of things may break with a future update and not be caught immediately? Or there may be cases currently where something may be broken and nobody has noticed yet?

Just trying to get an idea of the actual risk of running non-native HLS in safari. We'd really like our player to look the same across platforms if possible, and if necessary (if non-native HLS is really a bad idea) we'll need to put in some special cases for our quality chooser.

gkatsev commented 3 years ago

Sort of both. The risk is likely not that big at this point (it used to be much bigger a long time ago). If you test your stream, and it works for you, I wouldn't worry too much. Also, worth noting that you can't run non-native HLS on iPhones, though, you can on iPads. This is a platform limitation.

jgcaruso commented 3 years ago

Also, worth noting that you can't run non-native HLS on iPhones,

Thanks for that bit of info! I think that is the decider for us 😄 We'll need to try something clever with our quality chooser instead.

gkatsev commented 3 years ago

II would recommend to not bother and just not have a quality picker on those platforms.