mirror of
https://github.com/shaka-project/shaka-player.git
synced 2026-06-13 15:46:46 +03:00
feat: Add Device API (#8210)
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>
This commit is contained in:
committed by
GitHub
parent
9ac3f51473
commit
970d7756ea
+4
-3
@@ -404,9 +404,10 @@ describe('UI', () => {
|
||||
|
||||
UiUtils.confirmElementFound(videoContainer, 'shaka-seek-bar');
|
||||
|
||||
// The default settings vary in mobile/desktop/SmartTV context.
|
||||
if (shaka.util.Platform.isMobile() ||
|
||||
shaka.util.Platform.isSmartTV()) {
|
||||
// The default settings vary in mobile/desktop context.
|
||||
const deviceType = deviceDetected.getDeviceType();
|
||||
if (deviceType == shaka.device.IDevice.DeviceType.MOBILE ||
|
||||
deviceType == shaka.device.IDevice.DeviceType.TV) {
|
||||
UiUtils.confirmElementFound(videoContainer,
|
||||
'shaka-play-button-container');
|
||||
UiUtils.confirmElementFound(videoContainer, 'shaka-play-button');
|
||||
|
||||
Reference in New Issue
Block a user