1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Removed dead code

This commit is contained in:
Cromefire_ 2020-07-27 18:54:04 +02:00
parent 28a489a148
commit a98d0ed759
No known key found for this signature in database
GPG key ID: D3D3DB179F435F0C

View file

@ -47,26 +47,6 @@ function tryRemoveElement(elem) {
} }
} }
let _supportsTextTracks;
function supportsTextTracks() {
if (_supportsTextTracks == null) {
_supportsTextTracks = document.createElement('video').textTracks != null;
}
// For now, until ready
return _supportsTextTracks;
}
function supportsCanvas() {
return !!document.createElement('canvas').getContext;
}
function supportsWebWorkers() {
return !!window.Worker;
}
function enableNativeTrackSupport(currentSrc, track) { function enableNativeTrackSupport(currentSrc, track) {
if (track) { if (track) {
@ -160,11 +140,6 @@ function supportsTextTracks() {
return useHtml ? result.replace(/\n/gi, '<br>') : result; return useHtml ? result.replace(/\n/gi, '<br>') : result;
} }
function setTracks(elem, tracks, item, mediaSource) {
elem.innerHTML = getTracksHtml(tracks, item, mediaSource);
}
function getTextTrackUrl(track, item, format) { function getTextTrackUrl(track, item, format) {
if (itemHelper.isLocalItem(item) && track.Path) { if (itemHelper.isLocalItem(item) && track.Path) {
@ -179,22 +154,6 @@ function supportsTextTracks() {
return url; return url;
} }
function getTracksHtml(tracks, item, mediaSource) {
return tracks.map(function (t) {
if (t.DeliveryMethod !== 'External') {
return '';
}
const defaultAttribute = mediaSource.DefaultSubtitleStreamIndex === t.Index ? ' default' : '';
const language = t.Language || 'und';
const label = t.Language || 'und';
return `<track id="textTrack${t.Index}" label="${label}" kind="subtitles" src="${getTextTrackUrl(t, item)}" srclang="${language}"${defaultAttribute}></track>`;
}).join('');
}
function getDefaultProfile() { function getDefaultProfile() {
return import('browserdeviceprofile').then(({default: profileBuilder}) => { return import('browserdeviceprofile').then(({default: profileBuilder}) => {
@ -463,7 +422,7 @@ function supportsTextTracks() {
requireHlsPlayer(() => { requireHlsPlayer(() => {
const hls = new Hls({ const hls = new Hls({
manifestLoadingTimeOut: 20000, manifestLoadingTimeOut: 20000,
xhrSetup(xhr, xhr_url) { xhrSetup(xhr) {
xhr.withCredentials = true; xhr.withCredentials = true;
} }
//appendErrorMaxRetry: 6, //appendErrorMaxRetry: 6,
@ -574,7 +533,6 @@ function supportsTextTracks() {
const media = event.data.media || {}; const media = event.data.media || {};
const url = media.contentId; const url = media.contentId;
const contentType = media.contentType.toLowerCase(); const contentType = media.contentType.toLowerCase();
const options = media.customData;
let protocol; let protocol;
const ext = 'm3u8'; const ext = 'm3u8';
@ -653,8 +611,6 @@ function supportsTextTracks() {
destroyFlvPlayer(this); destroyFlvPlayer(this);
destroyCastPlayer(this); destroyCastPlayer(this);
const tracks = getMediaStreamTextTracks(options.mediaSource);
this.#subtitleTrackIndexToSetOnPlaying = options.mediaSource.DefaultSubtitleStreamIndex == null ? -1 : options.mediaSource.DefaultSubtitleStreamIndex; this.#subtitleTrackIndexToSetOnPlaying = options.mediaSource.DefaultSubtitleStreamIndex == null ? -1 : options.mediaSource.DefaultSubtitleStreamIndex;
if (this.#subtitleTrackIndexToSetOnPlaying != null && this.#subtitleTrackIndexToSetOnPlaying >= 0) { if (this.#subtitleTrackIndexToSetOnPlaying != null && this.#subtitleTrackIndexToSetOnPlaying >= 0) {
const initialSubtitleStream = options.mediaSource.MediaStreams[this.#subtitleTrackIndexToSetOnPlaying]; const initialSubtitleStream = options.mediaSource.MediaStreams[this.#subtitleTrackIndexToSetOnPlaying];
@ -1214,7 +1170,7 @@ function supportsTextTracks() {
/** /**
* @private * @private
*/ */
fetchSubtitlesUwp(track, item) { fetchSubtitlesUwp(track) {
return Windows.Storage.StorageFile.getFileFromPathAsync(track.Path).then(function (storageFile) { return Windows.Storage.StorageFile.getFileFromPathAsync(track.Path).then(function (storageFile) {
return Windows.Storage.FileIO.readTextAsync(storageFile); return Windows.Storage.FileIO.readTextAsync(storageFile);
}).then(function (text) { }).then(function (text) {
@ -1678,7 +1634,7 @@ function supportsTextTracks() {
} }
} }
duration(val) { duration() {
const mediaElement = this.#mediaElement; const mediaElement = this.#mediaElement;
if (mediaElement) { if (mediaElement) {
const duration = mediaElement.duration; const duration = mediaElement.duration;
@ -1690,7 +1646,7 @@ function supportsTextTracks() {
return null; return null;
} }
canSetAudioStreamIndex(index) { canSetAudioStreamIndex() {
if (browser.tizen || browser.orsay) { if (browser.tizen || browser.orsay) {
return true; return true;
} }