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

fix: Avoid multiple-registration warning messages by accepting only the first contrib-ads per context. #421

Merged
merged 3 commits into from
Aug 23, 2018

Conversation

misteroneill
Copy link
Member

@misteroneill misteroneill commented Aug 20, 2018

Depends on #415, will change the base branch after that PR is merged.

Someone could still de-register contrib-ads, but that will not affect the middleware, so code now exists to ensure that middleware is only defined once by contrib-ads (from this version on).

@misteroneill
Copy link
Member Author

This should also go into the same release as #415.

src/register.js Outdated
return Boolean(videojs.getPlugin(NAME));
}

const Player = videojs.getComponent('Player');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a comment would be useful here, I'm not sure why this check is needed.

src/register.js Outdated
const {playMiddleware, isMiddlewareMediatorSupported} = playMiddlewareFeature;

// The plugin name.
const NAME = 'ads';
Copy link
Contributor

Choose a reason for hiding this comment

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

I recognize it's subjective, but extracting this to a variable doesn't seem valuable to me. The string is not likely to change and I don't see this as providing extra safety in this case. Importing it in other files seems tedious.

@misteroneill misteroneill changed the base branch from stitched-ads to master August 23, 2018 19:02
@misteroneill misteroneill merged commit c46ed1a into master Aug 23, 2018
@misteroneill misteroneill deleted the dupe-detection branch August 23, 2018 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants