Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Ortb Params #12

Merged
merged 18 commits into from
Feb 17, 2022
Merged
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
17 changes: 12 additions & 5 deletions modules/videojsVideoProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,20 @@ export function VideojsProvider(config, videojs_, adState_, timeState_, callback
}

let playBackMethod = PLAYBACK_METHODS.CLICK_TO_PLAY
const isMuted = player.muted() || player.autoplay() === 'muted'; // todo autoplayAdsMuted only applies to preRoll
if (player.autoplay()) {
// returns a boolean or a string with the autoplay strategy
const autoplay = player.autoplay();
const muted = player.muted() || autoplay === 'muted';
if (autoplay!==false) {
playBackMethod = isMuted ? PLAYBACK_METHODS.AUTOPLAY_MUTED : PLAYBACK_METHODS.AUTOPLAY;
}
const supportedMediaTypes = Object.values(VIDEO_MIME_TYPE).filter(
// Follows w3 spec https://www.w3.org/TR/2011/WD-html5-20110113/video.html#dom-navigator-canplaytype
type => player.canPlayType(type) !== ''
).concat([VPAID_MIME_TYPE])
)
if(videojs.ima.vpaidMode){
supportedMediaTypes.push(VPAID_MIME_TYPE)
}

const video = {
mimes: supportedMediaTypes,
// Based on the protocol support provided by the videojs-ima plugin
Expand All @@ -66,8 +72,9 @@ export function VideojsProvider(config, videojs_, adState_, timeState_, callback
// TODO: Make sure this returns dimensions in DIPS
h: player.currentHeight(),
w: player.currentWidth(),
placement: PLACEMENT.IN_STREAM,
// both linearity forms are supported
// May not be in stream if videojs is only used to serve ad content
// placement: PLACEMENT.IN_STREAM,
AnirudhRahul marked this conversation as resolved.
Show resolved Hide resolved
// both linearity forms are supported so the param is excluded
// sequence - TODO not yet supported
// battr: adConfig.battr, TODO: Not sure where this should be coming from
Copy link
Collaborator

Choose a reason for hiding this comment

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

just FYI this would probably have to be specified by the publisher or some content metadata. No need to worry about it for now

maxextended: -1,
Expand Down