Socket
Socket
Sign inDemoInstall

react-whammy

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-whammy

A React Component For Real-time Javascript WebM Video Encoder


Version published
Weekly downloads
519
increased by18.22%
Maintainers
1
Install size
60.9 kB
Created
Weekly downloads
 

Readme

Source

React Whammy: A React Component for Real Time JavaScript WebM Encoder

This is a React Component for the original JS Library > Whammy.

For detail explanation, please visit original library. Essentially, this is a library to convert Canvases into a .webm using JS with easy to use API and adjustable FPS.

All the credit goes to the original creator, this library just fixed some critical bugs and convert to React Component.

Demo (Using Chrome)

http://antimatter15.github.com/whammy/clock.html

http://www.sysord.fr/Sysord/ressource_whammy.jsf

Basic Usage

Install and import it into the react project

npm -i s react-whammy
import Whammy from 'react-whammy'

Initialise the Encoder

var encoder = new Whammy.Video(15)

That 15 over there is the frame rate.

Add Canvas

encoder.add(context or canvas or dataURL);

Here, you can add a frame, this happens fairly quickly because basically all it's doing is running .toDataURL() on the canvas (which isn't exactly a speed-demon either, but it's acceptable enough most of the time) and plopping the result onto an array (no computation or anything). The actual encoding only happens when you call .compile()

encoder.compile(false, (output) => {
	const video = URL.createObjectURL(output)
})

And you're done. Awesome.

Keywords

FAQs

Last updated on 29 Sep 2020

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc