Socket
Socket
Sign inDemoInstall

kettle-corn

Package Overview
Dependencies
27
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    kettle-corn

Synchronize an embedded video player with other components on a page


Version published
Weekly downloads
437
decreased by-8.58%
Maintainers
1
Install size
2.79 MB
Created
Weekly downloads
 

Readme

Source

kettle-corn

Build Status semantic-release

A MobX Store that reflects video state so it can be synchronized with other page components.

wut?

A lot of times when you embed a video in a web page, you want to have components on that webpage respond to video progress. You can use events and manipulate the DOM directly, but that becomes a mess pretty quickly.

This library tries to simplify that process by providing a React component for embedding video (YouTube and Vimeo supported, so far) and making the video state observable using MobX.

the kettle

The Kettle -- named after an ongoing popcorn/movie joke -- stores the data from the embedded videos. The embedding copmponents in kettle corn update the state of the kettle, which is made observable by MobX.

Since the state of the Kettle can be observed, it is possible to react to changes in the video state, synchronizing it with other parts of the application.

The Kettle also holds an observable message queue. This allows other components to make requests of the embedded video components. A video component observes the message queue and reacts to any changes. Based on the message, it can change the state of the player (Play, Pause, Seek to a position, etc.).

embedding videos

Kettle corn provides React components that work with the Kettle. For example, the YouTube component embeds a YouTube player. It takes a Kettle as a property. When the video updates, it updates the Kettle, which can be observed by other components.

To switch to a Vimeo video, you only need to swap the YouTube component for the VimeoPlayer component. The rest of your page can stay intact, since it is bound to the Kettle, rather then a particular player.

see more

Still not sure? Want to see it in action? Great! I have just the thing!

install

$> yarn add kettle-corn

$> npm install kettle-corn

FAQs

Last updated on 04 Apr 2024

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