VideoJS: don't use videojs.registerPlugin()
to start Google Analytics
The `registerPlugin()` call should only be done once, and not for every video shown. This removes the warning about the 'analytics' plugin already being registered, which you see when navigating from one video to another via the JSTree.
This commit is contained in:
parent
05c488c484
commit
3f8e0396cf
@ -59,16 +59,14 @@ script(type="text/javascript").
|
||||
}
|
||||
};
|
||||
|
||||
videojs.registerPlugin('analytics', function() {
|
||||
videojs(videoPlayer, options).ready(function() {
|
||||
this.ga({
|
||||
'eventLabel' : '{{ node._id }} - {{ node.name }}',
|
||||
'eventCategory' : '{{ node.project }}',
|
||||
'eventsToTrack' : ['start', 'error', 'percentsPlayed']
|
||||
});
|
||||
});
|
||||
|
||||
videojs(videoPlayer, options).ready(function() {
|
||||
this.hotkeys();
|
||||
|
||||
});
|
||||
|
||||
function addVideoPlayerButton(data) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user