media-woofer

0.0.2 • Public • Published

<media-woofer>

Kick up the bass of your media element! 🔉

Put this tag in the page with your <video> or <audio> tag and it will shake the element along with the bass (using the Web Audio API and CSShake), and also vibrate mobile phones (currently Android only) using the Vibration API.

Becuz why not? ¯\_(ツ)_/¯

Example

<html>
<head>
  <script type="module" src="https://unpkg.com/media-woofer"></script>
</head>
<body>

  <video src="https://woofer.media/site/videos/pony-sample.mp4" controls></video>
  <media-woofer></media-woofer>

</body>
</html>

Installing

<media-woofer> is packaged as a javascript module (es6) only, which is supported by all evergreen browsers and Node v12+.

Loading into your HTML using <script>

Note the type="module", that's important.

Modules are always loaded asynchronously by the browser, so it's ok to load them in the head 👍, and best for registering web components quickly.

<head>
  <script type="module" src="https://unpkg.com/media-woofer"></script>
</head>

Adding to your app via npm

npm install media-woofer --save

Or yarn

yarn add media-woofer

Include in your app javascript (e.g. src/App.js)

import 'media-woofer';

This will register the custom elements with the browser so they can be used as HTML.

Package Sidebar

Install

npm i media-woofer

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

5.85 kB

Total Files

4

Last publish

Collaborators

  • heff