Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Cast): Force TS content to be transmuxed on Chromecast #6262

Merged

Conversation

joeyparrish
Copy link
Member

@joeyparrish joeyparrish commented Feb 21, 2024

Although Chromecast natively supports TS content, it does not work in all cases. In particular, we have some sample live streams where some TS segments can be parsed by external tools as valid TS, but cause the Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin transmuxer to take over parsing.

This also removes the use of cast.__platform__.canDisplayType to patch MediaSource.isTypeSupported on Chromecast. Current versions of Shaka Player are doing very rough filtering with isTypeSupported before calling MediaCapabilities.decodingInfo. And our MediaCapabilities polyfill calls cast.__platform__.canDisplayType directly, bypassing any polyfill we might install on isTypeSupported. So there is no longer any purpose to canDisplayType in isTypeSupported.

Closes #5278

Although Chromecast natively supports TS content, it does not work in
all cases.  In particular, we have some sample live streams where some
TS segments can be parsed by external tools as valid TS, but cause the
Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin
transmuxer to take over parsing.

This also removes the use of cast.__platform__.canDisplayType to patch
MediaSource.isTypeSupported on Chromecast.  Current versions of Shaka
Player are doing very rough filtering with isTypeSupported before
calling MediaCapabilities.decodingInfo.  And our MediaCapabilities
polyfill calls cast.__platform__.canDisplayType directly, bypassing
any polyfill we might install on isTypeSupported.  So there is no
longer any purpose to canDisplayType in isTypeSupported.

Closes shaka-project#5278
@shaka-bot
Copy link
Collaborator

Incremental code coverage: 80.00%

Copy link

@alekzz alekzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a request for this particular CL, but IMHO this file is better to have unit tests given it has some logic.

@alekzz alekzz merged commit b8905bd into shaka-project:main Feb 21, 2024
15 of 18 checks passed
@avelad
Copy link
Collaborator

avelad commented Feb 21, 2024

@joeyparrish Since TS causes so many problems, I wonder if we shouldn't reject it on all platforms and always use the transmuxer...

@joeyparrish
Copy link
Member Author

We are practically there already. I'm okay with it. Or maybe it should be a config that's on by default, to give partners a choice about risking the native TS on a platform to save some CPU cycles.

@joeyparrish joeyparrish deleted the force-transmuxing-ts-on-chromecast branch February 21, 2024 17:50
@avelad
Copy link
Collaborator

avelad commented Feb 21, 2024

I would add a configuration to be able to use native TS or not, and if you do not have a transmuxer, always use the native one. And the default should always be to use the transmuxer for TS. With this code you always block TS even if it works in some cases (for example in VOD). My opinion is that it should be configurable...

@joeyparrish
Copy link
Member Author

I agree. That sounds good to me. Let's make it an option that is not platform-specific, which defaults to always transmuxing TS when we can.

joeyparrish added a commit that referenced this pull request Feb 26, 2024
Although Chromecast natively supports TS content, it does not work in
all cases. In particular, we have some sample live streams where some TS
segments can be parsed by external tools as valid TS, but cause the
Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin
transmuxer to take over parsing.

This also removes the use of `cast.__platform__.canDisplayType` to patch
MediaSource.isTypeSupported on Chromecast. Current versions of Shaka
Player are doing very rough filtering with isTypeSupported before
calling MediaCapabilities.decodingInfo. And our MediaCapabilities
polyfill calls `cast.__platform__.canDisplayType` directly, bypassing
any polyfill we might install on isTypeSupported. So there is no longer
any purpose to canDisplayType in isTypeSupported.

Closes #5278
joeyparrish added a commit that referenced this pull request Feb 26, 2024
Although Chromecast natively supports TS content, it does not work in
all cases. In particular, we have some sample live streams where some TS
segments can be parsed by external tools as valid TS, but cause the
Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin
transmuxer to take over parsing.

This also removes the use of `cast.__platform__.canDisplayType` to patch
MediaSource.isTypeSupported on Chromecast. Current versions of Shaka
Player are doing very rough filtering with isTypeSupported before
calling MediaCapabilities.decodingInfo. And our MediaCapabilities
polyfill calls `cast.__platform__.canDisplayType` directly, bypassing
any polyfill we might install on isTypeSupported. So there is no longer
any purpose to canDisplayType in isTypeSupported.

Closes #5278
joeyparrish added a commit that referenced this pull request Feb 27, 2024
Although Chromecast natively supports TS content, it does not work in
all cases. In particular, we have some sample live streams where some TS
segments can be parsed by external tools as valid TS, but cause the
Chromecast to throw a parsing error.

We should reject TS content on Chromecast, and allow the builtin
transmuxer to take over parsing.

This also removes the use of `cast.__platform__.canDisplayType` to patch
MediaSource.isTypeSupported on Chromecast. Current versions of Shaka
Player are doing very rough filtering with isTypeSupported before
calling MediaCapabilities.decodingInfo. And our MediaCapabilities
polyfill calls `cast.__platform__.canDisplayType` directly, bypassing
any polyfill we might install on isTypeSupported. So there is no longer
any purpose to canDisplayType in isTypeSupported.

Closes #5278
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 21, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Apr 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HLS AES-128 Live mode not working on Chromecast
4 participants