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

Polyfill ReadableStream on the devices that partially support it #4752

Closed
subhanahmed047 opened this issue Nov 24, 2022 · 3 comments
Closed
Labels
status: archived Archived and locked; will not be updated type: enhancement New feature or request

Comments

@subhanahmed047
Copy link
Contributor

Have you read the FAQ and checked for duplicate open issues?
Yes

Is your feature request related to a problem? Please describe.

While working on a promised PR for this issue on the Panasonic TV, after getting past the robustness problem, the player started throwing the NETWORK.UNSUPPORTED_SCHEME error.

Upon investigation, I realised that the http or https schemes are never registered on this TV. This means that this code never runs because shaka.net.HttpFetchPlugin.isSupported() returns false.

I can confirm that the TV has support for the following objects:
window.fetch => supported
window.ReadableStream => supported
window.AbortController => supported after Joey's Polyfill PR

The only thing is, the code

 new ReadableStream({});

throws an Uncaught TypeError: Illegal constructor error. Even tho the object is present.

Describe the solution you'd like

I was wondering if the Shaka player (if it doesn't already) can polyfill the ReadableStream to support it properly.

Additional context

This device uses chrome 49.
Polyfills are available for the ReadableStream such as this one.

@subhanahmed047 subhanahmed047 added the type: enhancement New feature or request label Nov 24, 2022
@github-actions github-actions bot added this to the Backlog milestone Nov 24, 2022
@avelad
Copy link
Member

avelad commented Nov 24, 2022

Panasonic TV has xhr support? I say this because the fallback should be working.

On the other hand, the polyfill created by Joey doesn't work when network requests have to be aborted, see this: #4707 (comment)

@subhanahmed047
Copy link
Contributor Author

@avelad where does it fall back to the XHR? Panasonic Does support XHR.

https://github.com/shaka-project/shaka-player/blob/main/lib/net/networking_engine.js/#L441-L442
at this point, the object and plugin are undefined. Also, the schemes_ object doesn't include any schemes. That makes me think it's not even falling back.

@subhanahmed047
Copy link
Contributor Author

I've decided to polyfill the ReadableStream inside my app instead of asking Shaka to do it.

@avelad avelad removed this from the Backlog milestone Dec 8, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Feb 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2023
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 type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants