amclin / videojs-scene7

Scene7 tech plugin for VideoJS
MIT License
3 stars 2 forks source link

videojs-scene7

semantic-release Build Status Coverage Status David Dependancy Status David Dev Dependancy Status

NPM

Tech plugin for VideoJS to support Scene7 players

Installation

npm install --save videojs-scene7

Usage

To include videojs-scene7 on your website or web application, use any of the following methods.

<script> Tag with a <video> tag

This is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available. Make sure to set:

<script src="https://github.com/amclin/videojs-scene7/raw/master//path/to/video.min.js"></script>
<script src="https://github.com/amclin/videojs-scene7/raw/master//path/to/videojs-scene7.min.js"></script>
<video id='my-video'
  controls
  autoplay
  >
  <source src='Scene7SharedAssets/Adobe_QBP-AVS' type='videojs/scene7'>
</video>
<script>
  var player = videojs('my-video',{
    techOrder: [ 'Scene7']
  });

  player.scene7();
</script>

Browserify/CommonJS

When using with Browserify, install videojs-scene7 via npm and require the plugin as you would any other module.

var videojs = require('video.js');

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require('videojs-scene7');

var player = videojs('my-video',{
  techOrder: [ 'Scene7']
});

player.scene7();

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the plugin as you normally would:

require(['video.js', 'videojs-scene7'], function(videojs) {
  var player = videojs('my-video',{
    techOrder: [ 'Scene7']
  });

  player.scene7();
});

Options

Provide Scene7 options to VideoJS through the normal VideoJS options object or data-options attribute. The options

options: {
  scene7: {
    serverurl: "https://s7d1.scene7.com/is/image/", // Path to Scene7 server
    videoserverurl: "https://s7d1.scene7.com/is/content/", // 
  }
}

serverurl

URL to the image API for Scene7. Default when not set is https://s7d1.scene7.com/is/image/

videoserverurl

URL to the content API for Scene7. Default when not set is https://s7d1.scene7.com/is/content/

contenturl

URL to the content API for Scene7 where losed caption and chapter navigation assets are located. Default when not set is https://s7d1.scene7.com/is/content/

License

MIT. Copyright (c) Anthony McLin <npm@anthonymclin.com>