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

vitorfreitas/dynamic-player

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A small library that listens to scroll events to play multimedia

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published