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

Allow WebP and AVIF image streams #3856

Merged
merged 5 commits into from Jan 13, 2022
Merged

Conversation

avelad
Copy link
Collaborator

@avelad avelad commented Jan 12, 2022

Fixes: #3845

lib/util/stream_utils.js Outdated Show resolved Hide resolved
* @const {string}
* @private
*/
shaka.util.StreamUtils.minAvifImage = 'data:image/avif;base64,AAAAIGZ0eXBhdm' +
Copy link
Member

Choose a reason for hiding this comment

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

I can't believe how large this tiny AVIF image is. I played around in https://squoosh.app/ and only managed to shave it down from 311 bytes to 305. :-(

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have not found a smaller one that works well :(

lib/util/stream_utils.js Outdated Show resolved Hide resolved
lib/util/stream_utils.js Show resolved Hide resolved
Copy link
Member

@joeyparrish joeyparrish left a comment

Choose a reason for hiding this comment

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

I'm going to run additional tests in our lab to make sure things like new Image() are available in all supported platforms. Unfortunately, I am unable to test Tizen right now. We're still in process of moving into a new building, and that device has not been mounted yet.

@avelad
Copy link
Collaborator Author

avelad commented Jan 13, 2022

According to https://developer.mozilla.org/en-US/docs/Web/API/HTMLImageElement/Image should be supported in all browsers (since Chrome v1! )

@joeyparrish
Copy link
Member

Thanks for that! In any case, even if new Image were missing on some device, then AVIF and WebP would simply not be supported because the isImageSupported_ Promise would be rejected. I'll run the tests anyway, though. :-)

@joeyparrish joeyparrish merged commit 9f3fb46 into shaka-project:master Jan 13, 2022
@avelad avelad deleted the webp-avif branch January 14, 2022 06:33
shaka-bot pushed a commit that referenced this pull request Jan 18, 2022
This better reflects the code landed in PR #3856

Issue #3845

Change-Id: I301f1d70c7c52454c22c6d0ee7c9d1461d7e7691
@avelad avelad added this to the v4.0 milestone May 4, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow WebP and AVIF image streams
2 participants