Ran a multi codec test and transitioning from AAC to AC3 fails silently
on Hisense VIDAA (there's no audio), despite `changeType` indicating
else wise.
We should disable SMOOTH for this device, similar to Tizen and webOS.
During my tests I wasn't able to find a webOS TV which could handle
smooth codec switching properly. Let's disable it on all platform,
similar to what we've done on Tizen back in the day.
### Summary
When playing a live HLS stream on Xbox, I was running into the following
error as soon as the playhead hit a discontinuity:
```
CHUNK_DEMUXER_ERROR_APPEND_FAILED: Sample encryption info is not available.
```
I noticed that [this
fix](https://github.com/shaka-project/shaka-player/pull/6719) was added
a while back to address this exact issue. A few months ago, [another
PR](https://github.com/shaka-project/shaka-player/pull/8210) was
submitted to abstract the feature detection logic, which I believe
unfortunately caused a regression.
The `requiresClearAndEncryptedInitSegments` helper was implemented in
both the Abstract Device and the Default Browser, but it looks like it
wasn't implemented in the Xbox class. This resulted in
`requiresClearAndEncryptedInitSegments` always returning false on that
platform (defaulting to the Abstract Device class's implementation,
which returns `false`).
This made the following logic (that fixed the
CHUNK_DEMUXER_ERROR_APPEND_FAILED error) fail:
```
if (device.requiresClearAndEncryptedInitSegments()) {
const doubleInitSegment = new Uint8Array(initSegment.byteLength +
modifiedInitSegment.byteLength);
doubleInitSegment.set(modifiedInitSegment);
doubleInitSegment.set(initSegment, modifiedInitSegment.byteLength);
return doubleInitSegment;
}
```
### Fix
Overriding this function in the Xbox class fixes the problem.
### Result
Playback now proceeds through HLS discontinuities on Xbox without
CHUNK_DEMUXER_ERROR_APPEND_FAILED.
The goal is to simplify and abstract feature logic detection. Currently
lots of places depend on various calls to `shaka.util.Platform` and
mainteinance of this is hard & not easy to read.
By introducing device API ideally rest of the player logic would look
into device features instead of directly checking platform. Additionally
we can more easily cache needed values, so we won't have to parse user
agent several times anymore.
---------
Co-authored-by: Álvaro Velad Galván <ladvan91@hotmail.com>