Socket
Book a DemoInstallSign in
Socket

edenspiekermann-bright

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

edenspiekermann-bright

easy to use brightcove facade

2.0.0
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

bright

This facade wraps the brightcove smart player api with an easy to use interface.

Installation

Until the library is published on npm you can install it via the github url scheme.

npm install edenspiekermann-bright --save

Usage

The source files are built by webpack to the UMD format. This means you can require dist/bright.js via webpack, browserify or require.js. Although it’s not recommended you can also include dist/bright.min.js in your html. This creates a global variable called Bright.

Common.js (webpack, browserify…)

var Bright = require('bright'); // installed via npm
var Bright = require('./path_to/bright.js'); // use the one in the dist folder

var player = Bright(options);

Require.js

require(['Bright'], function(Bright) {
  var player = Bright(options);
});

Global Variable

<script src="//admin.brightcove.com/js/BrightcoveExperiences.js"></script>
<script src="bright.min.js"></script>
<script src="your_scripts.js">
// main.js
var player = Bright(options);

Note: //admin.brightcove.com/js/BrightcoveExperiences.js has to be loaded before bright.js. Use your favorite script loader or simply add a script tag before your main js file.

API

Example HTML:

<div id="player"></div>

The brightcove player will be appended as a child to this element.

var player = Bright({
  element: domElement, // [required] parent dom element of the video player
  video: videoId,      // [required] reference id ('ref:XXXXX') or video id (number)
  player: playerKey    // [required] playerKey of the brightcove player

  // append other brightcove options here (optional)
});

player.on('end', function(player) {
  player.load(videoId);
});

Possible options for brightcove can be found at this page from the official documentation.

Currently supported events:

  • load
  • play
  • pause
  • end

These event methods are copied from maxhoffmann/emitter:

  • on(event, fn)
  • once(event, fn)
  • off(event, fn)

Testing

Video and player id for testing are taken from brightcove’s example page. You may have to update them if they change.

Development

  • Clone the repository
  • npm install
  • npm start to watch for file changes in src/bright.js
  • make changes
  • npm test starts a local server & opens your default browser with http://localhost:8000/tests
  • npm run build if all tests pass
  • push to develop, merge into master

FAQs

Package last updated on 11 Aug 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.