Fix IE10 split error

On IE10, Plyr throws the error `Unable to get property 'split' of undefined or null reference`. This fixes the case when `window.navigator.language` is null and can't use the `split()` function.
This commit is contained in:
Nicolas Thiry 2018-04-12 22:12:12 +02:00 committed by GitHub
parent ffd265d0ae
commit 766dd03d81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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