Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Player integration for Freewheel video ad server #177

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add vprn
MelizzaP committed Oct 11, 2016
commit 54018d83369ff28bbebcaa6d6120560d5df9efb3
9 changes: 9 additions & 0 deletions elements/bulbs-video/components/revealed.js
Original file line number Diff line number Diff line change
@@ -213,6 +213,7 @@ export default class Revealed extends React.Component {
vastUrl (videoMeta) {
let hostChannel = videoMeta.hostChannel;
let videohubReferenceId = videoMeta.id;
let randomVideoPlayerNumber = videoMeta.vprn;
let baseUrl = `http://${window.FREEWHEEL_NETWORK_ID}.v.fwmrm.net/ad/g/1?`;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the freewheel network hash

let vastTestId = this.vastTest(window.location.search);

@@ -221,6 +222,7 @@ export default class Revealed extends React.Component {
baseUrl += '&csid=' + this.buildCsid(hostChannel);
baseUrl += '&caid=' + this.buildCaid(videohubReferenceId);
baseUrl += '&pvrn=' + this.cacheBuster();
baseUrl += '&vprn=' + randomVideoPlayerNumber;

return baseUrl;
}
@@ -248,6 +250,13 @@ export default class Revealed extends React.Component {
element.id = videoMeta.gaPrefix;
let player = global.jwplayer(element);

// random video player number ending with video id
// to be used in vastUrl query string
let randomVideoPlayerNumber = parseInt(
`${this.cacheBuster()}${videoMeta.id}`
);
videoMeta.vprn = randomVideoPlayerNumber;

player.videoMeta = videoMeta;

let playerOptions = {
5 changes: 5 additions & 0 deletions elements/bulbs-video/components/revealed.test.js
Original file line number Diff line number Diff line change
@@ -685,6 +685,7 @@ describe('<bulbs-video> <Revealed>', () => {
let element;
let player;
let videoMeta;
let cacheBusterStub;

beforeEach(() => {
element = {};
@@ -750,6 +751,7 @@ describe('<bulbs-video> <Revealed>', () => {
gaPrefix: 'videoplayer0',
});
playerSetup = sinon.spy();
cacheBusterStub = sinon.stub().returns('456');
player = {
setup: playerSetup,
};
@@ -782,6 +784,7 @@ describe('<bulbs-video> <Revealed>', () => {
props: {},
extractSources: extractSourcesStub,
vastUrl: vastUrlStub,
cacheBuster: cacheBusterStub,
extractTrackCaptions: extractTrackCaptionsStub,
}, element, videoMeta);
});
@@ -855,6 +858,7 @@ describe('<bulbs-video> <Revealed>', () => {
props: {},
extractSources: extractSourcesStub,
vastUrl: vastUrlStub,
cacheBuster: cacheBusterStub,
extractTrackCaptions: extractCaptionsStub,
}, element, videoMeta);
});
@@ -883,6 +887,7 @@ describe('<bulbs-video> <Revealed>', () => {
props: { disableSharing: true },
extractSources: extractSourcesStub,
vastUrl: vastUrlStub,
cacheBuster: cacheBusterStub,
extractTrackCaptions: extractTrackCaptionsStub,
}, element, videoMeta);
});