Giter Site home page Giter Site logo

moovie.js's Introduction

moovie.js - Movie focused HTML5 Player

◼️ Features:

  • 🔧 Fully Customizable
  • 💎 Built-in Caption Offset Adjust on the fly
  • 💪 No Dependencies, built with VanillaJS
  • 🌎 Tested in All Modern Browsers
  • 💻 Responsive
  • ⌨️ Standardized Shortcuts
  • 🛠 Standardized Events

◼️ Coming soon:

  • 🔥 Full support for .str captions
  • 🔥 Add tracks dinamically
  • 🔥 Caption customization
  • 🔥 Improved responsive behavior
  • 🔥 Adjust speed on the fly

◼️ Demo:

https://bmsvieira.github.io/moovie.js/

◼️ Installation:

1 - Include JavaScript Source.

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

2 - Include Styles.

<link rel="stylesheet" href="path/to/moovie.css">

4 - Set HTML.

<video id="example" poster="<<path-to-poster>>">
  <source src="<<path-to-file.mp4>>" type="video/mp4">
  <track kind="captions" label="Portuguese" srclang="pt" src="<<path-to-caption.vtt>>">
  <track kind="captions" label="English" srclang="en" src="<<path-to-caption.vtt>>">
  Your browser does not support the video tag.
</video>

3 - Initilize.

document.addEventListener("DOMContentLoaded", function() {
   var demo1 = new Moovie({
     selector: "#example",
     dimensions: {
          width: "100%"
     }
   });
});

◼️ Captions:

Currently it has full support for WebVTT (.vtt). To add a track use the standard html as the example above shows.

◼️ Caption Offset Adjust:

It is possible to adjust the offset by a total of 10 seconds (-5 / +5) on the fly.

◼️ Shortcuts:

Key Description
Space Bar Toggle Play
K Toggle Play
F Toggle Fullscreen
-> Forward 5 seconds
<- Backward 5 seconds
M Toggle Mute

Methods:

GetPlayerElement: Get generated player element, so it can be added eventListeners.

demo1.GetPlayerElement();

TogglePlay: Play/Pause video

demo1.TogglePlay();

ToogleSubtitles: Enable/Disable subtitles

demo1.ToogleSubtitles();

ToogleFullscreen: Enable/Disable fullscreen

demo1.ToogleFullscreen();

moovie.js's People

Contributors

bmsvieira avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.