chore: disable ads in demo site

This commit is contained in:
Sam Potts 2022-04-20 14:50:29 +10:00
parent 04e6c43da7
commit d7086074e8

View File

@ -17,9 +17,10 @@ import toggleClass from './toggle-class';
(() => { (() => {
const production = 'plyr.io'; const production = 'plyr.io';
const isProduction = window.location.host.includes(production);
// Sentry for demo site (https://plyr.io) only // Sentry for demo site (https://plyr.io) only
if (window.location.host === production) { if (isProduction) {
Sentry.init({ Sentry.init({
dsn: 'https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555', dsn: 'https://d4ad9866ad834437a4754e23937071e4@sentry.io/305555',
whitelistUrls: [production].map((d) => new RegExp(`https://(([a-z0-9])+(.))*${d}`)), whitelistUrls: [production].map((d) => new RegExp(`https://(([a-z0-9])+(.))*${d}`)),
@ -53,10 +54,10 @@ import toggleClass from './toggle-class';
captions: { captions: {
active: true, active: true,
}, },
ads: { /* ads: {
enabled: window.location.host.includes(production), enabled: isProduction,
publisherId: '918848828995742', publisherId: '918848828995742',
}, }, */
previewThumbnails: { previewThumbnails: {
enabled: true, enabled: true,
src: ['https://cdn.plyr.io/static/demo/thumbs/100p.vtt', 'https://cdn.plyr.io/static/demo/thumbs/240p.vtt'], src: ['https://cdn.plyr.io/static/demo/thumbs/100p.vtt', 'https://cdn.plyr.io/static/demo/thumbs/240p.vtt'],