2.0.7 • Published 8 years ago
vigour-player v2.0.7
player
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
8 years ago
2.0.6
8 years ago
2.0.5
8 years ago
2.0.4
8 years ago
2.0.3
8 years ago
2.0.2
8 years ago
2.0.1
8 years ago
2.0.0
8 years ago
1.2.20
8 years ago
1.2.19
8 years ago
1.2.18
8 years ago
1.2.17
8 years ago
1.2.16
8 years ago
1.2.15
8 years ago
1.2.14
8 years ago
1.2.13
8 years ago
1.2.12
8 years ago
1.2.11
8 years ago
1.2.10
8 years ago
1.2.9
8 years ago
1.2.8
8 years ago
1.2.7
8 years ago
1.2.6
8 years ago
1.2.5
8 years ago
1.2.4
8 years ago
1.2.3
8 years ago
1.2.2
8 years ago
1.2.1
8 years ago
1.2.0
8 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.0
8 years ago