Git Product home page Git Product logo

avif.js's People

Contributors

dependabot[bot] avatar kagami avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

avif.js's Issues

Demo is not working

demo/index.html is not working due to the numerous JS errors
even if I change to

<script **type="module"** src="index.js"></script>

e.g.
index.js:5 Uncaught ReferenceError: require is not defined
at index.js:5:14

index.html:1 Uncaught (in promise) TypeError: Failed to register a ServiceWorker for scope ('https://tst.1st-social.com/html/avif.js/') with script ('https://.../avif.js/avif-sw.js'): ServiceWorker script evaluation failed

Support HDR AVIF via HDR Canvas

Microsoft Edge 110+ supports HDR Canvas, HDR AV1 video, and HDR JPEG

Edge HDR canvas can be done via enabling "Experimental Features" flag in edge://flags and then creating a canvas via:

// Create HDR canvas in Chrome/Edge 110+if enabled in chrome://flags "Experimental Features ON"
surface = canvas.getContext("2d", {colorSpace:'rec2100-pq', pixelFormat:'float16'});
canvas.drawingBufferColorSpace = 'rec2100-pq';
canvas.unpackColorSpace = 'rec2100-pq';

Then HDR works. I'd like to support HDR AVIF files in Microsoft Edge.

Doesn't work on first page load

Service worker is not yet active when page is loaded for first time, thus image is not loading on first page load.
How to reproduce: open in incognito mode.

Doesn't work on Chrome Mobile

It doesn't work on Chrome Mobile although Chrome is specified as supported browser.

I guess the reason for this is that Chrome Mobile relies on Android for video codecs and Android doesn't support AV1 yet. So as with other browsers it could be resolved with polyfill.

Probably it's good idea to state in README that for now it works only on desktop Chrome.

?src= query parameter for alternative test files

I have a test AVIF file on the Bitcoin SV blockchain: https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f

I'd like to be able to demo this file to people via something like:

https://kagami.github.io/avif.js/?src=https://bico.media/4c97b18d3f157b593045fe1525f5fdc608bc207e4729964855604ad40dc77e0f

Certainly people can download the file from the blockchain and then use the "Load" button, but streamlining this for other sample files would be cool!

Other sample/test file libraries:

https://github.com/AOMediaCodec/av1-avif/tree/master/testFiles

http://download.opencontent.netflix.com/?prefix=AV1/Chimera/AVIF/

Thanks!

Need help to generate a UMD module

Hello,

I'm quite lost on how to generate a UMD module to use in a browser. I have an error while using browserify, which seems to be linked to babelify, which I need to use first apparently. There's no clear explanation on how to do that. Can you provide a guide on how to do so ?

Static html support

I was wondering if it would be possible to use this solution in static websites aswell
Like webp-hero does! Just include one JavaScript and everything just works! No need to get node :)

Polyfill fails on refresh for individual images

(Using Firefox 88.)

I loaded the demo page happily. Then I opened a single image in a new tab (using right-click + "Open Image in New Tab"). This fails.

A hard reload (shift-reload) fixes the problem and shows the image, but reloading the page normally (f5, ctrl-r) shows the same error. The message in the console is:

Failed to load ‘https://kagami.github.io/avif.js/Mexico.5f45d60c.avif’. A ServiceWorker passed a promise to FetchEvent.respondWith() that rejected with ‘TypeError: can't access property "id", e is undefined’. avif-sw.js:8:856

Vue support

I am using Vue for my website, and I cannot get this polyfill to work.

When using the require/register method in the Readme, Edge will complain with the following error (On localhost):

An SSL certificate error occurred when fetching the script.
Which is strange, because the website works fine. The certificate is self-signed, but it is accepted.

When directly importing the files like this:

import 'avif.js/avif.js';
import 'avif.js/avif-sw.js';

Nothing happens. Safari on iOS doesn't seem to do anything in the above scenarios. I cannot debug on desktop Safari, because I haven no more mac OS devices.

Not that it's of much value, but Firefox and Chrome both don't work. On Firefox it's because of the ServiceWorker being unsupported, I believe that this is a known issue.

Does anyone know how to get this working in Vue? I would love AVIF support in browsers which do not support it!

Vitepress introduces plug-ins to compile error

I used this plug-in in the blog built by vitepress, but the compiler reported an error

image

my package.json

{
  "name": "vitepress",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "dev": "vitepress dev docs --open",
    "build": "vitepress build docs",
    "serve": "vitepress serve docs"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@algolia/client-search": "^4.14.2",
    "@types/node": "^18.11.18",
    "vitepress": "1.0.0-alpha.40"
  },
  "dependencies": {
    "avif.js": "^0.2.0"
  }
}

can u help me ?

All the pictures on my blog are in avif format, but edge browsers do not support avif format. I hope to let edge browsers display pictures through your plug-in. This is my request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.