diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js
index 69dc4d9a96..802bb58001 100644
--- a/src/plugins/htmlVideoPlayer/plugin.js
+++ b/src/plugins/htmlVideoPlayer/plugin.js
@@ -1,15 +1,15 @@
-import browser from "browser";
-import events from "events";
-import appHost from "apphost";
-import loading from "loading";
-import dom from "dom";
-import playbackManager from "playbackManager";
-import appRouter from "appRouter";
-import connectionManager from "connectionManager";
-import htmlMediaHelper from "htmlMediaHelper";
-import itemHelper from "itemHelper";
-import screenfull from "screenfull";
-import globalize from "globalize";
+import browser from 'browser';
+import events from 'events';
+import appHost from 'apphost';
+import loading from 'loading';
+import dom from 'dom';
+import playbackManager from 'playbackManager';
+import appRouter from 'appRouter';
+import connectionManager from 'connectionManager';
+import htmlMediaHelper from 'htmlMediaHelper';
+import itemHelper from 'itemHelper';
+import screenfull from 'screenfull';
+import globalize from 'globalize';
/* eslint-disable indent */
@@ -92,7 +92,7 @@ function supportsTextTracks() {
}
if (track) {
- const format = (track.Codec || "").toLowerCase();
+ const format = (track.Codec || '').toLowerCase();
if (format === 'ssa' || format === 'ass') {
return false;
}
@@ -139,7 +139,7 @@ function supportsTextTracks() {
}
function normalizeTrackEventText(text, useHtml) {
- const result = text.replace(/\\N/gi, "\n").replace(/\r/gi, "");
+ const result = text.replace(/\\N/gi, '\n').replace(/\r/gi, '');
return useHtml ? result.replace(/\n/gi, '
') : result;
}
@@ -169,17 +169,17 @@ function supportsTextTracks() {
return '';
}
- const defaultAttribute = mediaSource.DefaultSubtitleStreamIndex === t.Index ? " default" : "";
+ const defaultAttribute = mediaSource.DefaultSubtitleStreamIndex === t.Index ? ' default' : '';
- const language = t.Language || "und";
- const label = t.Language || "und";
+ const language = t.Language || 'und';
+ const label = t.Language || 'und';
return '';
}).join('');
}
function getDefaultProfile() {
- return import("browserdeviceprofile").then(profileBuilder => {
+ return import('browserdeviceprofile').then(profileBuilder => {
return profileBuilder({});
});
@@ -230,7 +230,7 @@ function supportsTextTracks() {
incrementFetchQueue() {
if (this._fetchQueue <= 0) {
this.isFetching = true;
- events.trigger(this, "beginFetch");
+ events.trigger(this, 'beginFetch');
}
this._fetchQueue++;
@@ -244,7 +244,7 @@ function supportsTextTracks() {
if (this._fetchQueue <= 0) {
this.isFetching = false;
- events.trigger(this, "endFetch");
+ events.trigger(this, 'endFetch');
}
}
@@ -252,7 +252,7 @@ function supportsTextTracks() {
* @private
*/
updateVideoUrl(streamInfo) {
- const isHls = streamInfo.url.toLowerCase().includes(".m3u8");
+ const isHls = streamInfo.url.toLowerCase().includes('.m3u8');
const mediaSource = streamInfo.mediaSource;
const item = streamInfo.item;
@@ -262,7 +262,7 @@ function supportsTextTracks() {
// Edit: Also seeing stalls from hls.js
if (mediaSource && item && !mediaSource.RunTimeTicks && isHls && streamInfo.playMethod === 'Transcode' && (browser.iOS || browser.osx)) {
- const hlsPlaylistUrl = streamInfo.url.replace("master.m3u8", "live.m3u8");
+ const hlsPlaylistUrl = streamInfo.url.replace('master.m3u8', 'live.m3u8');
loading.show();
@@ -310,11 +310,11 @@ function supportsTextTracks() {
setSrcWithFlvJs(instance, elem, options, url) {
return import('flvjs').then(flvjs => {
const flvPlayer = flvjs.createPlayer({
- type: "flv",
+ type: 'flv',
url: url
},
{
- seekType: "range",
+ seekType: 'range',
lazyLoad: false
});
@@ -454,13 +454,13 @@ function supportsTextTracks() {
const options = media.customData;
let protocol;
- const ext = "m3u8";
+ const ext = 'm3u8';
const mediaElement = this._mediaElement;
const host = new cast.player.api.Host({
- "url": url,
- "mediaElement": mediaElement
+ 'url': url,
+ 'mediaElement': mediaElement
});
if (ext === 'm3u8' ||
@@ -623,7 +623,7 @@ function supportsTextTracks() {
// if .ass currently rendering
if (this.currentSubtitlesOctopus) {
this.updateCurrentTrackOffset(offsetValue);
- this.currentSubtitlesOctopus.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + offsetValue;;
+ this.currentSubtitlesOctopus.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + offsetValue;
} else {
const trackElement = this.getTextTrack();
// if .vtt currently rendering
@@ -687,7 +687,7 @@ function supportsTextTracks() {
*/
isAudioStreamSupported(stream, deviceProfile) {
- const codec = (stream.Codec || "").toLowerCase();
+ const codec = (stream.Codec || '').toLowerCase();
if (!codec) {
return true;
@@ -926,7 +926,7 @@ function supportsTextTracks() {
htmlMediaHelper.seekOnPlaybackStart(this, e.target, this._currentPlayOptions.playerStartPositionTicks, function () {
if (this.currentSubtitlesOctopus) {
- this.currentSubtitlesOctopus.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + currentTrackOffset;
+ this.currentSubtitlesOctopus.timeOffset = (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000 + this.currentTrackOffset;
this.currentSubtitlesOctopus.resize();
this.currentSubtitlesOctopus.resetRenderAheadCache(false);
}
@@ -1005,9 +1005,9 @@ function supportsTextTracks() {
/**
* @type {HTMLMediaElement}
*/
- const elem = e.target
+ const elem = e.target;
const errorCode = elem.error ? (elem.error.code || 0) : 0;
- const errorMessage = elem.error ? (elem.error.message || "") : "";
+ const errorMessage = elem.error ? (elem.error.message || '') : '';
console.error('media element error: ' + errorCode.toString() + ' ' + errorMessage);
let type;
@@ -1111,7 +1111,7 @@ function supportsTextTracks() {
return new Promise((resolve, reject) => {
const xhr = new XMLHttpRequest();
- const url = getTextTrackUrl(track, item, ".js");
+ const url = getTextTrackUrl(track, item, '.js');
xhr.open('GET', url, true);
@@ -1173,7 +1173,7 @@ function supportsTextTracks() {
timeOffset: (this._currentPlayOptions.transcodingOffsetTicks || 0) / 10000000,
// new octopus options; override all, even defaults
- renderMode: "blend",
+ renderMode: 'blend',
dropAllAnimations: false,
libassMemoryLimit: 40,
libassGlyphLimit: 40,
@@ -1225,7 +1225,7 @@ function supportsTextTracks() {
renderSubtitlesWithCustomElement(videoElement, track, item) {
this.fetchSubtitles(track, item).then((data) => {
if (!this.videoSubtitlesElem) {
- const subtitlesContainer = document.createElement("div");
+ const subtitlesContainer = document.createElement('div');
subtitlesContainer.classList.add('videoSubtitles');
subtitlesContainer.innerHTML = '