Skip to content

Commit

Permalink
Merge pull request #5412 from guardian/sensitive-content-videos
Browse files Browse the repository at this point in the history
Hide video adverts and 'more in section' when told to
  • Loading branch information
Richard Nguyen committed Aug 6, 2014
2 parents fe2b242 + e9d33ea commit 241320c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions common/app/assets/javascripts/bootstraps/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ define([
if (mediaType === 'video') {

modules.bindDiagnosticsEvents(player);
player.fullscreener();

// Init plugins
if(config.switches.videoAdverts) {
if (config.switches.videoAdverts && !config.page.shouldHideAdverts) {
player.adCountDown();
player.fullscreener();
player.ads({
timeout: 3000
});
Expand All @@ -295,7 +295,7 @@ define([
modules.bindContentEvents(player);
}

if(/desktop|wide/.test(detect.getBreakpoint())) {
if (/desktop|wide/.test(detect.getBreakpoint())) {
modules.initEndSlate(player);
}
} else {
Expand Down Expand Up @@ -402,11 +402,13 @@ define([
}

if (config.isMedia) {
modules.initMoreInSection();
if (config.page.showRelatedContent) {
modules.initMoreInSection();
}
modules.initMostViewedMedia();
}

if(config.page.contentType === 'Video' && detect.getBreakpoint() !== 'mobile') {
if (config.page.contentType === 'Video' && detect.getBreakpoint() !== 'mobile') {
modules.displayReleaseMessage();
}
};
Expand Down

0 comments on commit 241320c

Please sign in to comment.