This commit is contained in:
Sam Potts
2018-04-14 14:58:09 +10:00
parent e45109e1d7
commit 3061a701d5
14 changed files with 1867 additions and 830 deletions

View File

@ -115,7 +115,7 @@ const defaults = {
// Captions settings
captions: {
active: false,
language: window.navigator.language ? window.navigator.language.split('-')[0] : 'en',
language: (navigator.language || navigator.userLanguage).split('-')[0],
},
// Fullscreen settings

View File

@ -293,6 +293,10 @@ class Listeners {
// If autoplay, then load advertisement if required
// TODO: Show some sort of loading state while the ad manager loads else there's a delay before ad shows
utils.on(this.player.media, 'playing', () => {
if (!this.player.ads) {
return;
}
// If ads are enabled, wait for them first
if (this.player.ads.enabled && !this.player.ads.initialized) {
// Wait for manager response