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

FDL-751 ad param replacement for dailymotion video player #43

Open
wants to merge 3 commits into
base: stage-env
Choose a base branch
from
Open
Changes from all commits
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
20 changes: 19 additions & 1 deletion etc/docker/nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
# FDL-751
map $http_user_agent $ad_device_prefix {
default 'sta_';
~*(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge\ |maemo|midp|mmp|mobile.+firefox|netfront|opera\ m(ob|in)i|palm(\ os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows\ ce|xda|xiino/i 'mob_';
~*android|ipad|playbook|silk/i 'sta_';
}
map $server_name $ad_host {
default 'wmn';
~*(waz) 'waz';
}
# /FDL-751

server {
listen 80;
server_name _;
Expand Down Expand Up @@ -48,6 +60,7 @@ server {
location ~ ^/index\.php(/|$) {

# workaround for tags in amp (amp-converter strips them off)
sub_filter_once off;
sub_filter '<!--amp-ad' '<amp-ad';
sub_filter '</amp-ad-->' '</amp-ad>';
sub_filter '<!--amp-sticky-ad' '<amp-sticky-ad';
Expand All @@ -62,7 +75,12 @@ server {
sub_filter '/manifest.json"-->' '/manifest.json">';
sub_filter '<!--script' '<script';
sub_filter '</script-->' '</script>';
sub_filter_once off;
# FDL-751
sub_filter '></amp-dailymotion></figure>' 'data-param-ads_params="amp_wmn/opener" data-mute="true" autoplay></amp-dailymotion></figure>';
sub_filter '></amp-dailymotion>' 'data-param-ads_params="amp_wmn/inline" data-mute="true" autoplay></amp-dailymotion>';
sub_filter '[sitename]' '$ad_device_prefix$ad_host';
sub_filter '[playerposition]' 'inline';
# /FDL-751

sub_filter '<iframe id="kaltura_player_' '<iframe class="kaltura_embed" id="kaltura_player_';

Expand Down