bas-meteor-jwplayer

1.1.1 • Public • Published

JWPlayer for Meteor (v1.4.3+)

Donate to this project using Paypal

Integrate a CDN hosted version of JWPlayer using your own license.

NOTE: This version only works with JWPlayer v7

Install

meteor npm install bas-meteor-jwplayer

Setup

Load globally:

import { JWPlayer } from 'bas-meteor-jwplayer';
 
JWPlayer.load('YOUR_KEY_HERE');

Or only on specific routes:

import { JWPlayer } from 'bas-meteor-jwplayer';
 
// Iron Router
Router.onBeforeAction(function() {
  JWPlayer.load('YOUR_KEY_HERE');
  this.next();
}, { only: ['route1', 'route2'] });
import { JWPlayer } from 'bas-meteor-jwplayer';
 
// Flow Router
FlowRouter.triggers.enter([JWPlayer.load('YOUR_KEY_HERE')], {
  only: ['route1', 'route2']
});

Config

Template HTML

<template name="myTemplate">
  <div id="player"></div>
</template>

Template JS

import { JWPlayer } from 'bas-meteor-jwplayer';
 
// use JWPlayer.loaded() to reactively check that the lib is ready
Template.myTemplate.onRendered(function() {
  this.autorun(function() {
    if (JWPlayer.loaded) {
      jwplayer('player').setup({
        file: 'http://example.com/my-video.mp4',
        width: '100%',
        aspectratio: '16:9',
        autostart: true
      });
    }
  });
});

Resources

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

No sponsors yet! Will you be the first?

Donate to this project using Paypal

Contributors

These amazing people have contributed code to this project:

Contribute

If you wish you can contribute to the development of this project:

  • Contribute with your code

  • Donate

License

Contact

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    2
    • latest

Version History

Package Sidebar

Install

npm i bas-meteor-jwplayer

Weekly Downloads

2

Version

1.1.1

License

MIT

Unpacked Size

12.7 kB

Total Files

17

Last publish

Collaborators

  • basgrani