npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mmp.video

v0.1.0

Published

MMP Packages: video library for desktop and mobile devices

Downloads

6

Readme

Make Me Pulse : Video Library

Bower version

MMP Packages: video library for desktop and mobile devices

Table of contents

Installation

  • Install with Bower: bower install mmp.video

Documentation

This package uses module exports.

Examples

Examples are located to src/scripts/examples.

Examples:

  • basic video
  • callback basic video (ready/loaded/...)
  • context including VideoManager (to manipulate all video instances for play/pause/mute)
  • fullscreen video
  • controls elements for video (play/pause/stop/seek/progress cursor)
  • controls callback for video (play/pause from buttons)

Compatibility

Supported on:

  • Safari 6+
  • Firefox 24+
  • Chrome 30+
  • Internet Explorer (waiting tests)
  • Windows Phone 8.0+
  • Android (waiting tests)
  • iOS (7.0+)

Video

Options

  • urls: (default {}) specify an object of video extension urls. Extension allowed are mp4, webm, ogv, m4v and mov. Video script will choose automatically the better format desktop. For mobile, video extension used by default is m4v.

  • cache: (default true) prevent cache when you're loading a video multiple times. Add random number at the end of video filename if you're set cache to false. (example: filename.mp4?1234)

  • autoload: (default true) preload video after object instanciation. Video can be loaded later with load method.

  • autoplay: (default false) play video after being loaded.

  • isFullscreen: (default false) set fullscreen video. Important: you must use the resize method of video object or video manager to resize video

  • isMuted: (default false) play video audio

  • isLoop: (default false) loop video

  • volume: (default .5) video volume

  • containerId: (default video) id container (do not include # symbol)

  • videoId: (default video-(random number)) id video (do not include # symbol)

  • poster: (default null) poster video jpg

  • size: (default {}) specify container width and container height of video. Example: {width: 200, height: 200}. if you use fullscreen video, do not specify video size

  • callbacks: (default {}) video callbacks. see example to have the list of all callbacks available.

    • videoLoadedCallback: (default null) video metadata loaded
    • videoCanPlayCallback: (default null) video loaded and can play (readyState > 1)
    • videoReadyCallback: (default null) video ok to be played (readyState == 4)
    • videoEndCallback: (default null) video end
    • videoRemovedCallback: (default null) callback video removed from dom and object properties removed

Methods

videoDuration()

return video duration or 0 if video node is not added to DOM duration in milliseconds

--

timeRemaining()

return video time remaining or 0 if video node is not added to DOM time in milliseconds

--

load()

load video

--

play()

play video node and update controls time seekbar if controls are enabled

--

pause()

pause video node pause controls time seekbar if controls are enabled

--

stop()

stop video and set current time to 0. set control time seekbar to 0 if controls are enabled

--

restart()

restart video node

--

skip(time)

skip video time time in milliseconds

--

setVolume(volume)

set volume to video

  • volume: (float) 0 to 1

--

setCurrentTime(currentTime)

set current time currentTime in milliseconds

  • currentTime: (int)

--

setFullscreen()

set video fullscreen

--

show()

show video by removing hidden class. Note: video is shown if autoplay is set to true

--

hide()

hide video by adding hidden class

--

addControls: (doneCallback, controlsOptions)

add controls options. see callbacks controls example for more information.

  • doneCallback: (default: null) promise callback that lets video script matching global events to default controls video elements.
  • controlsOptions: (default: null) controls class elements
    • controlContainerId:
    • playId: play button dom class
    • pauseId: pause button dom class
    • seekBarId: seek bar button dom class note: seekbar on default interface is an svg element
    • seekBarProgressId: seek bar progress class
    • seekBarBandId: seek bar band class

These properties can be edited to control options.

--

remove()

remove video instance

--

resize()

resize video container. call this method in window resize event to have a fullscreen video. window sizes are set automatically.

Video Manager

Options

  • videos: (default []) list all video instances

  • context: (default desktop) define video context (actually desktop or mobile). you have two video instances: VideoDesktop and VideoMobile. You can use this object or specify custom context to video manager and instanciate video with Video for better code comprehension.

Methods

resize()

resize videos which need to be resized. Depends on each video options

--

mute()

mute all videos

--

unmute()

unmute all videos

--

play()

play all videos

--

pause()

pause all videos

--

stop()

stop all videos

--

setMobileContext()

set mobile context will instanciate all Video class instances according to VideoMobile class. Useful if you work with mobile devices because you don't need to replace Video object by VideoMobile object.

--

setDesktopContext()

set mobile context will instanciate all Video class instances according to VideoMobile class. used by default