canalplus / rx-player

DASH/Smooth HTML5 Video Player
https://developers.canal-plus.com/rx-player/
Apache License 2.0
870 stars 132 forks source link

Add `isRepresentationPlayable` util #1539

Open peaBerberian opened 2 months ago

peaBerberian commented 2 months ago

While working on #1533, I noticed that there is a high number of places in the code where we want to know if a given Representation can probably be playable or not (is not known to be undecipherable and in an unsupported codec).

I added an isRepresentationPlayable util to make those places more clear about the intent than checking a couple properties.

I made it return undefined for the special case where the codec support is still undefined as what we would want to do in this case depends.