Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/lijialiang/webp-canvas

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/lijialiang/webp-canvas

  • v0.0.0-20170928030032-9c8e9e267858
  • Source
  • Go
  • Socket score

Version published
Created
Source

webp-canvas

Based on libwebpjs to parse WebP files, and display them on Canvas elements for compatibility with browsers that do not support WebP files.

Some optimization, through Worker to download and parse WebP files to prevent the impact of page thread.

中文查看

Simple Usage

<!DOCTYPE html>
<html>
<head>
    <title> WebP Canvas Example </title>
</head>
<body>

    <canvas id="canvas"></canvas>

    <script src="../dist/webp-canvas.min.js"></script>

    <script>
        WebPCanvas.config( '../dist/webp-canvas.worker.min.js' );

        var webpCanvas = new WebPCanvas({
            canvas: '#canvas',
            webp: '1.webp',
            mounted: function () {
                webpCanvas.play();
            },
        });
    </script>

</body>
</html>

Because of cross-domain issues, need to put the Worker file, source files and WebP files in the same primary domain.

→ Example

FAQs

Package last updated on 28 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc