Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

Latest commit

 

History

History
59 lines (41 loc) · 1.26 KB

README.md

File metadata and controls

59 lines (41 loc) · 1.26 KB

Dynamic Player

A small library to play multimedia (video/audio) on scroll.

Checkout the demo here

Getting started

For this library get to work, you'll have to follow some steps.

1. Include Dynamic Player on your site

You can download it directly from GitHub

<script src="/path/to/DynamicPlayer.js"></script>

2. Add the markup to your HTML

<body>
  ...
  <video id="my-video" controls>
    <source src="./my/video/path.mp4" />
  </video>
  ...
</body>

3. Initialize DynamicScroll w/ multimedia options object

const multimediaOptions = {
  selector: '#my-video',
  playOnCoords: { x: 0, y: 1230 }
  // Video will play when the user scrolls vertically 1230 pixels
};

const myVideo = new DynamicPlayer(multimediaOptions);
myVideo.init();

Browser compatibility

Dynamic Player works in all moderns browsers. It's built using ES6 classes, so it doesn't work on IE (yet).

TODO

  • Add demo
  • Minified version
  • Internet Explorer support
  • Send an array of multimedia objects as contructor
  • CDN link
  • NPM package

License

The code is available under MIT License.