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

ember-videojs

v0.0.25

Published

Use VideoJS components in your Ember project.

Downloads

1,141

Readme

ember-videojs

Use VideoJS HTML5 video player components in your Ember project.

Compatibility

  • Ember.js v2.18 or above
  • Ember CLI v2.13 or above
  • Node.js v8 or above

Installation

ember install ember-videojs

Usage

{{videojs-player src="https://vjs.zencdn.net/v/oceans.mp4" type="video/mp4" poster="https://vjs.zencdn.net/v/oceans.png"}}

Add multiple sources.

{{videojs-player sources=sources}}
this.set("sources", [
  {
    type: "video/mp4",
    src="https://vjs.zencdn.net/v/oceans.mp4"
  },
  {
    type: "video/webm",
    src="https://vjs.zencdn.net/v/oceans.webm"
  },
]);

VideoJS documentation

Autoplay

  • autoplay: true|false
{{videojs-player autoplay=true}}

Controls

  • controls: true|false
{{videojs-player controls=true}}

Plays inline

Plays inline for mobile Safari.

  • playsinline: true|false
{{videojs-player playsinline=true}}

Click to play without controls

{{!-- app/templates/components/player.hbs}}
{{videojs-player controls=false click=(action "togglePlay")}}
// app/components/player.js

actions: {
  togglePlay: function(player) {
    if (player.paused()) {
      player.play();
    } else {
      player.pause();
    }
  }
}

Sizing

  • width: an integer in pixels (VideoJS doesn't support CSS style sizing)
  • height: an integer in pixels (VideoJS doesn't support CSS style sizing)
  • fluid: adds the .vjs-fluid class and will scale to fit the container and content.
{{videojs-player width=640 height=320}}
{{videojs-player fluid=true}}

AspectRatio

  • aspectRatio: This option is in the form of two integers separated by a colon: for example 16:9 or 4:3.
{{videojs-player aspectRatio='16:9'}}

LiveUI

Use new Live UI for live streams.

  • liveui: This option is a boolean
{{videojs-player liveui=true}}

For more details please read official documentation https://docs.videojs.com/tutorial-live.html

360 videos and VR

Install the videojs-vr plugin

  • npm install --save videojs-vr

Add the import statement to your ember-cli-build.js file.

app.import('node_modules/videojs-vr/dist/videojs-vr.min.js');
app.import('node_modules/videojs-vr/dist/videojs-vr.min.js');

Add the vr-projection attribute to your component

  • vr-projection: '360', 'Sphere', or 'equirectangular'
{{videojs-player vrProjection="360"}}

Skinning

VideoJS doesn't provide a way to interact with it's styles. Just override them in your styles.css.

  .video-js .vjs-big-play-button {};
  .video-js .vjs-big-vr-play-button {};

  .video-js .vjs-control-bar {};
  .vjs-has-started .vjs-control-bar {};

  .video-js .vjs-control {};
  .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {};

  .vjs-icon-play:before, .video-js .vjs-big-play-button .vjs-icon-placeholder:before, .video-js .vjs-play-control .vjs-icon-placeholder:before {};

  .video-js .vjs-volume-panel {};

  .video-js .vjs-mute-control {};
  .vjs-icon-volume-high:before, .video-js .vjs-mute-control .vjs-icon-placeholder:before {};

  .video-js .vjs-progress-control {};

  .video-js .vjs-progress-holder .vjs-play-progress, .video-js .vjs-progress-holder .vjs-load-progress, .video-js .vjs-progress-holder .vjs-load-progress div {};

  .video-js .vjs-time-control {};

  .video-js .vjs-fullscreen-control {};
  .vjs-icon-fullscreen-enter:before, .video-js .vjs-fullscreen-control .vjs-icon-placeholder:before {};

  .vjs-icon-subtitles, .video-js .vjs-subtitles-button .vjs-icon-placeholder, .video-js .vjs-subs-caps-button .vjs-icon-placeholder, .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder, .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder, .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder, .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder {};

  .vjs-icon-subtitles:before, .video-js .vjs-subtitles-button .vjs-icon-placeholder:before, .video-js .vjs-subs-caps-button .vjs-icon-placeholder:before, .video-js.video-js:lang(en-GB) .vjs-subs-caps-button .vjs-icon-placeholder:before, .video-js.video-js:lang(en-IE) .vjs-subs-caps-button .vjs-icon-placeholder:before, .video-js.video-js:lang(en-AU) .vjs-subs-caps-button .vjs-icon-placeholder:before, .video-js.video-js:lang(en-NZ) .vjs-subs-caps-button .vjs-icon-placeholder:before {};

  /* Uses inline styles on the grandchild */
  .vjs-text-track-display {};

Closed captions and subtitles

Add a text track to your video in the WebVTT format.

  • textTrack: [track URL]
{{videojs-player textTrack="captions-mi.vtt"}}

Add multiple tracks or configure the text track options in your component.

{{videojs-player textTracks=textTracks}}
this.set("textTracks", [
  {
    kind: "captions",
    label: "Maori",
    language: "mi",
    src="captions-mi.vtt",
    type="text/vtt"
  },
  {
    kind: "captions",
    label: "English",
    language: "en",
    src="captions-en.vtt",
    type="text/vtt"
  }
]);

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.