Skip to content

Commit

Permalink
feat: Add support for WPE based browsers in RDK set-top boxes (#5852)
Browse files Browse the repository at this point in the history
Closes #5134
  • Loading branch information
avelad committed Nov 5, 2023
1 parent acf23f8 commit 2eedb12
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 33 deletions.
52 changes: 23 additions & 29 deletions README.md
Expand Up @@ -33,24 +33,24 @@ for the up-to-date list of maintained branches of Shaka Player.

## Platform and browser support matrix

|Browser |Windows |Mac |Linux |Android |iOS >= 13 |ChromeOS|Other|
|:---------:|:--------:|:-------:|:-------:|:-------:|:--------:|:------:|:---:|
|Chrome¹ |**Y** |**Y** |**Y** |**Y** |**Native**|**Y** | - |
|Firefox¹ |**Y** |**Y** |**Y** |untested⁵|**Native**| - | - |
|Edge¹ |**Y** | - | - | - | - | - | - |
|Edge Chromium|**Y** |**Y** |**Y** |untested⁵|**Native**| - | - |
|IE | N | - | - | - | - | - | - |
|Safari¹ | - |**Y** | - | - |**iPadOS 13<br>Native**| - | - |
|Opera¹ |untested⁵ |untested⁵|untested⁵|untested⁵|**Native**| - | - |
|Chromecast²| - | - | - | - | - | - |**Y**|
|Tizen TV³ | - | - | - | - | - | - |**Y**|
|WebOS⁶ | - | - | - | - | - | - |**Y**|
|Xbox One | - | - | - | - | - | - |**Y**|
|Playstation 4⁷| - | - | - | - | - | - |**Y**|
|Playstation 5⁷| - | - | - | - | - | - |**Y**|
|Browser |Windows |Mac |Linux |Android |iOS >= 9 |iOS >= 17.1|iPadOS >= 13|ChromeOS|Other|
|:------------:|:--------:|:-------:|:-------:|:-------:|:--------:|:---------:|:----------:|:------:|:---:|
|Chrome¹ |**Y** |**Y** |**Y** |**Y** |**Native**|**Native** |**Native** |**Y** | - |
|Firefox¹ |**Y** |**Y** |**Y** |untested⁵|**Native**|**Native** |**Native** | - | - |
|Edge¹ |**Y** | - | - | - | - | - | - | - | - |
|Edge Chromium |**Y** |**Y** |**Y** |untested⁵|**Native**|**Native** |**Native** | - | - |
|IE | N | - | - | - | - | - | - | - | - |
|Safari¹ | - |**Y** | - | - |**Native**|**Y** |**Y** | - | - |
|Opera¹ |untested⁵ |untested⁵|untested⁵|untested⁵|**Native**| - | - | - | - |
|Chromecast². | - | - | - | - | - | - | - | - |**Y**|
|Tizen TV³ | - | - | - | - | - | - | - | - |**Y**|
|WebOS⁶ | - | - | - | - | - | - | - | - |**Y**|
|Xbox One | - | - | - | - | - | - | - | - |**Y**|
|Playstation 4⁷| - | - | - | - | - | - | - | - |**Y**|
|Playstation 5⁷| - | - | - | - | - | - | - | - |**Y**|

NOTES:
- ¹: On macOS, only Safari 13+ is supported. On iOS, only iOS 13+ is
- ¹: On macOS, only Safari 9+ is supported. On iOS, only iOS 9+ is
supported. Older versions will be rejected.
- ²: The latest stable Chromecast firmware is tested. Both sender and receiver
can be implemented with Shaka Player.
Expand All @@ -65,18 +65,12 @@ NOTES:
- ⁷: These are expected to work, but are community-supported and untested by
us.

We support iOS 13+ through Apple's native HLS player. We provide the same
top-level API, but we just set the video's `src` element to the manifest/media.
So we are dependent on the browser supporting the manifests.

### Shaka Player Embedded (for native iOS)

We have another project called [Shaka Player Embedded][] which offers the same
features and similar APIs for native apps on iOS. This project uses its own
media stack, which allows it to play content that would otherwise not be
supported. This supports both DASH and HLS manifests.

[Shaka Player Embedded]: https://github.com/shaka-project/shaka-player-embedded
NOTES for iOS and iPadOS:
- We support iOS 9+ through Apple's native HLS player. We provide the same
top-level API, but we just set the video's `src` element to the manifest/media.
So we are dependent on the browser supporting the manifests.
- Since iPadOS 13 [MediaSource Extensions][] is supported
- Since iPadOS 17 and iOS 17.1 [ManagedMediaSource Extensions][] is supported


## Manifest format support matrix
Expand Down Expand Up @@ -135,7 +129,7 @@ HLS features supported:
- WebVTT and TTML
- CEA-608/708 captions
- Encrypted content with PlayReady and Widevine
- Encrypted content with FairPlay (Safari on macOS and iOS 13+ only)
- Encrypted content with FairPlay (Safari on macOS and iOS 9+ only)
- Key rotation
- Raw AAC, MP3, AC-3 and EC-3 (without an MP4 container)

Expand Down
4 changes: 1 addition & 3 deletions lib/player.js
Expand Up @@ -860,10 +860,8 @@ shaka.Player = class extends shaka.util.FakeEventTarget {
return false;
}

// We do not support iOS 9, 10, 11 or 12, nor those same versions of
// desktop Safari.
const safariVersion = shaka.util.Platform.safariVersion();
if (safariVersion && safariVersion < 13) {
if (safariVersion && safariVersion < 9) {
return false;
}

Expand Down
23 changes: 22 additions & 1 deletion lib/polyfill/mediasource.js
Expand Up @@ -40,7 +40,18 @@ shaka.polyfill.MediaSource = class {
} else if (safariVersion) {
// NOTE: shaka.Player.isBrowserSupported() has its own restrictions on
// Safari version.
if (safariVersion <= 12) {
if (safariVersion <= 10) {
// Safari 8 does not implement appendWindowEnd.
// Safari 9 & 10 do not correctly implement abort() on SourceBuffer.
// Bug filed: https://bugs.webkit.org/show_bug.cgi?id=160316
// Blacklist these very outdated versions.
// Bug filed: https://bugs.webkit.org/show_bug.cgi?id=165342
// Safari 10 fires spurious 'updateend' events after endOfStream().
// Bug filed: https://bugs.webkit.org/show_bug.cgi?id=165336

shaka.log.info('Blacklisting MSE on Safari <= 10.');
shaka.polyfill.MediaSource.blacklist_();
} else if (safariVersion <= 12) {
shaka.log.info('Patching Safari 11 & 12 MSE bugs.');
// Safari 11 & 12 do not correctly implement abort() on SourceBuffer.
// Calling abort() before appending a segment causes that segment to be
Expand Down Expand Up @@ -89,6 +100,16 @@ shaka.polyfill.MediaSource = class {
}
}

/**
* Blacklist the current browser by making
* MediaSourceEngine.isBrowserSupported fail later.
*
* @private
*/
static blacklist_() {
window['MediaSource'] = null;
}

/**
* Stub out abort(). On some buggy MSE implementations, calling abort()
* causes various problems.
Expand Down

0 comments on commit 2eedb12

Please sign in to comment.