2.0.7 • Published 9 years ago

vigour-player v2.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

player

js-standard-style npm version Build Status

A player wrapper for usage with vigour-element.

how to use

npm i --save vigour-player

Add the player to your app as a component and add your configuration.

Control the player by manipulating the attached state (or just inject the ui controls).

##setup

var e = require('vigour-element')
var player = require('vigour-player')

// define some data
var Observable = require('vigour-observable')
var Data = new Observable({
  inject: require('vigour-observable/lib/data'),
  Child: 'Constructor'
}).Constructor

// it expects a "video" field which will contain the video url (mpd, hls or mp4. Use .{type} for generic url.
var playerData = new Data({
	video: 'http://clips.vorwaerts-gmbh.de/VfE_html5.mp4'
})

// some configuration
player.config = {
	apiKey: apiKey,
}

// add some injectables eg. our default controls
player.inject.push(require('vigour-player/lib/controls'))

// add player component to your app
var app = e({
  components: {
    player: player
  },
  DOM: document.body
})

// add your player
app.set({
  myPlayer: {
    type: 'player'
  }
})

// add data to app
app.val = playerData

##configuring ads

// inject a protocol (currently only vast is included)
player.inject.push(require('vigour-player/lib/ad/vast'))

// configure your ads, for any given point in the video timeline
player.config.ads = {
	'0': [vasturlA],
	'0.5': [vasturlB, vasturlB]
}
2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.2.20

9 years ago

1.2.19

9 years ago

1.2.18

9 years ago

1.2.17

9 years ago

1.2.16

9 years ago

1.2.15

9 years ago

1.2.14

9 years ago

1.2.13

9 years ago

1.2.12

9 years ago

1.2.11

9 years ago

1.2.10

9 years ago

1.2.9

9 years ago

1.2.8

9 years ago

1.2.7

9 years ago

1.2.6

10 years ago

1.2.5

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.1

10 years ago

1.2.0

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago