Coder Social home page Coder Social logo

sujaudd1n / mmp4w Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 42 KB

Minimalist media player for web.

License: MIT License

JavaScript 95.97% CSS 0.44% HTML 3.59%
js js-video-player library minimal minimalist video video-library video-player video-player-library mmp4w

mmp4w's Introduction

MMP4W

Minimalist media player for web. Control volume, current time, play-pause easily from keyboard. Supports both videos and images.

CDN

https://cdn.jsdelivr.net/gh/sujaudd1n/mmp4w/src/mmp4w.min.js

Setup

  • Create a container element and set id as mmp4w_container.
<div id="mmp4w_container">
</div>
  • Set width and height for the container element. Video element takes full width and height of its parent.
/* example */
#mmp4w_container {
    width: 900px;
    height: 450px;
}
  • Add a script tag with defer attribute and type="module" in head tag of html document.
<script src="./script.js" type="module" defer></script>

Inside script.js import the mmp4w object.

import { mmp4w } from "./src/mmp4w.js";
// or from cdn
//import { mmp4w } from "https://cdn.jsdelivr.net/gh/sujaudd1n/mmp4w/src/mmp4w.min.js";

// Create an array of object. Each object represents a video element.

const videos = [
    { url: "<videourl>" },
    { url: "<videourl>" },
    { url: "<videourl>" },
    { url: "<videourl>" },
];

mmp4w.set_playlist(videos);

The setup is complete.

Keybindings

  • p - Play/pause the video.
  • s - Stop the video.
  • m - Mute.
  • k - Volume up.
  • j - Volume down.
  • r - Enable loop.
  • h - Previous.
  • l - Next.
  • ctrl-h - Seek behind.
  • ctrl-l - Seek front.
  • f - Fullscreen.
  • o - Chage video fit.
  • c - Show/hide video controls.

mmp4w's People

Contributors

sujaudd1n avatar

Stargazers

 avatar

Watchers

 avatar

mmp4w's Issues

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.