Closed phloxic closed 8 years ago
I cannot do this in canPlay
because afaics canPlay
receives only the source type
and the entire player conf, not the one for a specific source.
I may be able to find some way to solve this in the plugin.
The problem is that application/dash+xml
is not a media type per se, so canPlay
is in some ways misleading, as the actual check is for video/mp4;codecs=
with MediaSource.isTypeSupported
, so in many ways it's not the task of the core player to take care of this situation.
For the moment I don't see a way to fail over to a different engine, if the bailout happens at pick
and no other dash source is available - 'advanced option' ;-)
What info would you need in canPlay
to bailout in that phase?
The source options. It could then check for e.g. source.dashCodecs and if the client feature detection is buggy as on Android in this case, pretending that MediaSource canPlay mp4a.40.5 while real testing reveals that it doesn't, we can bail out without requiring another source of the same type being available. I believe this also would make it possible for the quality-selector to disable flash hls with the engine option set to "html5" instead of the clumsy check for !swfHls (present in player conf) which can lead to a similar situation (I'd have to go through it in practice again, but I remember unexpected behavior).
The situation: As (most or all?) Androids do not play he-aac audio in spite of advertising it in
MediaSource.isTypeSupported()
it would make sense to offer an addition source option to allow to fail over to a stream with lc-aac audio.This works as long a second stream to fail over to is present in the source array. If not, the player hangs in loading state instead of letting a different engine continue the picking.
While investigating this, I discovered that the check for the
engine
source option in the pick methods of both the dashjs and hlsjs plugins is redundant -pick
in core player takes care of it, it seems.@nnarhinen - can you confirm this? Is there a way to make a plugin engine.pick evaluate source options?