diff options
author | Albin Larsson <mail@albinlarsson.com> | 2018-06-13 22:18:57 +0200 |
---|---|---|
committer | Albin Larsson <mail@albinlarsson.com> | 2018-06-13 23:27:35 +0200 |
commit | 6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f (patch) | |
tree | dd08c02960036e7c029e9b9e2f1e0c633627d898 /src/js/captions.js | |
parent | 99ac8d4c5267e465d31b3045315a6865740e9c16 (diff) | |
download | plyr-6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f.tar.lz plyr-6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f.tar.xz plyr-6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f.zip |
Remove line breaks in arrays
Diffstat (limited to 'src/js/captions.js')
-rw-r--r-- | src/js/captions.js | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/js/captions.js b/src/js/captions.js index 6682d6f0..5f78e636 100644 --- a/src/js/captions.js +++ b/src/js/captions.js @@ -48,10 +48,7 @@ const captions = { const src = track.getAttribute('src'); const url = parseUrl(src); - if (url !== null && url.hostname !== window.location.href.hostname && [ - 'http:', - 'https:', - ].includes(url.protocol)) { + if (url !== null && url.hostname !== window.location.href.hostname && ['http:', 'https:'].includes(url.protocol)) { fetch(src, 'blob') .then(blob => { track.setAttribute('src', window.URL.createObjectURL(blob)); @@ -202,10 +199,9 @@ const captions = { const tracks = Array.from((this.media || {}).textTracks || []); // For HTML5, use cache instead of current tracks when it exists (if captions.update is false) // Filter out removed tracks and tracks that aren't captions/subtitles (for example metadata) - return tracks.filter(track => !this.isHTML5 || update || this.captions.meta.has(track)).filter(track => [ - 'captions', - 'subtitles', - ].includes(track.kind)); + return tracks + .filter(track => !this.isHTML5 || update || this.captions.meta.has(track)) + .filter(track => ['captions', 'subtitles'].includes(track.kind)); }, // Get the current track for the current language |