mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
WIP
This commit is contained in:
parent
96eccd2ecd
commit
7d9208e951
143 changed files with 1000 additions and 1008 deletions
|
@ -1,4 +1,5 @@
|
|||
/* eslint-disable indent */
|
||||
import { ConnectionManager } from 'jellyfin-apiclient';
|
||||
|
||||
class BackdropScreensaver {
|
||||
constructor() {
|
||||
|
@ -20,10 +21,10 @@ class BackdropScreensaver {
|
|||
Limit: 200
|
||||
};
|
||||
|
||||
const apiClient = window.connectionManager.currentApiClient();
|
||||
const apiClient = ConnectionManager.currentApiClient();
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then((result) => {
|
||||
if (result.Items.length) {
|
||||
import('slideshow').then(({default: Slideshow}) => {
|
||||
import('../../components/slideshow/slideshow').then(({default: Slideshow}) => {
|
||||
const newSlideShow = new Slideshow({
|
||||
showTitle: true,
|
||||
cover: true,
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import connectionManager from 'jellyfin-apiclient';
|
||||
import loading from '../../components/loading/loading';
|
||||
import keyboardnavigation from 'keyboardnavigation';
|
||||
import dialogHelper from 'dialogHelper';
|
||||
import dom from 'dom';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import './style';
|
||||
import keyboardnavigation from '../../scripts/keyboardNavigation';
|
||||
import dialogHelper from '../../components/dialogHelper/dialogHelper';
|
||||
import dom from '../../scripts/dom';
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import './style.css';
|
||||
import 'material-design-icons-iconfont';
|
||||
import '../../elements/emby-button/paper-icon-button-light';
|
||||
|
||||
|
@ -260,7 +259,7 @@ export class BookPlayer {
|
|||
};
|
||||
|
||||
const serverId = item.ServerId;
|
||||
const apiClient = window.connectionManager.getApiClient(serverId);
|
||||
const apiClient = ConnectionManager.getApiClient(serverId);
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
import('epubjs').then(({default: epubjs}) => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import dialogHelper from 'dialogHelper';
|
||||
import dialogHelper from '../../components/dialogHelper/dialogHelper';
|
||||
|
||||
export default class TableOfContents {
|
||||
constructor(bookPlayer) {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import appSettings from 'appSettings';
|
||||
import appSettings from '../../scripts/settings/appSettings';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
import playbackManager from 'playbackManager';
|
||||
import globalize from 'globalize';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import castSenderApiLoader from 'castSenderApiLoader';
|
||||
import { playbackManager } from '../../components/playback/playbackmanager';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import castSenderApiLoader from '../../components/castSenderApi';
|
||||
|
||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||
|
||||
|
@ -324,11 +324,11 @@ class CastPlayer {
|
|||
|
||||
let apiClient;
|
||||
if (message.options && message.options.ServerId) {
|
||||
apiClient = window.connectionManager.getApiClient(message.options.ServerId);
|
||||
apiClient = ConnectionManager.getApiClient(message.options.ServerId);
|
||||
} else if (message.options && message.options.items && message.options.items.length) {
|
||||
apiClient = window.connectionManager.getApiClient(message.options.items[0].ServerId);
|
||||
apiClient = ConnectionManager.getApiClient(message.options.items[0].ServerId);
|
||||
} else {
|
||||
apiClient = window.connectionManager.currentApiClient();
|
||||
apiClient = ConnectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
message = Object.assign(message, {
|
||||
|
@ -439,7 +439,7 @@ class CastPlayer {
|
|||
}
|
||||
|
||||
function alertText(text, title) {
|
||||
import('alert').then(({default: alert}) => {
|
||||
import('../../components/alert').then(({default: alert}) => {
|
||||
alert({
|
||||
text: text,
|
||||
title: title
|
||||
|
@ -672,7 +672,7 @@ class ChromecastPlayer {
|
|||
|
||||
playWithCommand(options, command) {
|
||||
if (!options.items) {
|
||||
const apiClient = window.connectionManager.getApiClient(options.serverId);
|
||||
const apiClient = ConnectionManager.getApiClient(options.serverId);
|
||||
const instance = this;
|
||||
|
||||
return apiClient.getItem(apiClient.getCurrentUserId(), options.ids[0]).then(function (item) {
|
||||
|
@ -984,7 +984,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
shuffle(item) {
|
||||
const apiClient = window.connectionManager.getApiClient(item.ServerId);
|
||||
const apiClient = ConnectionManager.getApiClient(item.ServerId);
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
||||
const instance = this;
|
||||
|
@ -997,7 +997,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
instantMix(item) {
|
||||
const apiClient = window.connectionManager.getApiClient(item.ServerId);
|
||||
const apiClient = ConnectionManager.getApiClient(item.ServerId);
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
||||
const instance = this;
|
||||
|
@ -1035,7 +1035,7 @@ class ChromecastPlayer {
|
|||
}
|
||||
|
||||
const instance = this;
|
||||
const apiClient = window.connectionManager.getApiClient(options.serverId);
|
||||
const apiClient = ConnectionManager.getApiClient(options.serverId);
|
||||
|
||||
return getItemsForPlayback(apiClient, {
|
||||
Ids: options.ids.join(',')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import globalize from 'globalize';
|
||||
import * as userSettings from 'userSettings';
|
||||
import appHost from 'apphost';
|
||||
import globalize from '../../scripts/globalize';
|
||||
import * as userSettings from '../../scripts/settings/userSettings';
|
||||
import { appHost } from '../../components/apphost';
|
||||
|
||||
// TODO: Replace with date-fns
|
||||
// https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php
|
||||
|
@ -29,7 +29,7 @@ function showMessage(text, userSettingsKey, appHostFeature) {
|
|||
return new Promise(function (resolve, reject) {
|
||||
userSettings.set(userSettingsKey, '1', false);
|
||||
|
||||
import('alert').then(({default: alert}) => {
|
||||
import('../../components/alert').then(({default: alert}) => {
|
||||
return alert(text).then(resolve, resolve);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import events from 'jellyfin-apiclient';
|
||||
import browser from 'browser';
|
||||
import appHost from 'apphost';
|
||||
import * as htmlMediaHelper from 'htmlMediaHelper';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import browser from '../../scripts/browser';
|
||||
import { appHost } from '../../components/apphost';
|
||||
import * as htmlMediaHelper from '../../components/htmlMediaHelper';
|
||||
|
||||
function getDefaultProfile() {
|
||||
return import('browserdeviceprofile').then(({ default: profileBuilder }) => {
|
||||
return import('../../scripts/browserDeviceProfile').then(({ default: profileBuilder }) => {
|
||||
return profileBuilder({});
|
||||
});
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ function supportsFade() {
|
|||
}
|
||||
|
||||
function requireHlsPlayer(callback) {
|
||||
import('hlsjs').then(({ default: hls }) => {
|
||||
import('hls.js').then(({ default: hls }) => {
|
||||
window.Hls = hls;
|
||||
callback();
|
||||
});
|
||||
|
@ -68,7 +68,7 @@ function enableHlsPlayer(url, item, mediaSource, mediaType) {
|
|||
|
||||
// issue head request to get content type
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('fetchHelper').then((fetchHelper) => {
|
||||
import('../../components/fetchhelper').then((fetchHelper) => {
|
||||
fetchHelper.ajax({
|
||||
url: url,
|
||||
type: 'HEAD'
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import browser from 'browser';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import appHost from 'apphost';
|
||||
import browser from '../../scripts/browser';
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import { appHost } from '../../components/apphost';
|
||||
import loading from '../../components/loading/loading';
|
||||
import dom from 'dom';
|
||||
import playbackManager from 'playbackManager';
|
||||
import appRouter from 'appRouter';
|
||||
import dom from '../../scripts/dom';
|
||||
import { playbackManager } from '../../components/playback/playbackmanager';
|
||||
import { appRouter } from '../../components/appRouter';
|
||||
import {
|
||||
bindEventsToHlsPlayer,
|
||||
destroyHlsPlayer,
|
||||
|
@ -22,10 +22,10 @@ import {
|
|||
getSavedVolume,
|
||||
isValidDuration,
|
||||
getBufferedRanges
|
||||
} from 'htmlMediaHelper';
|
||||
import itemHelper from 'itemHelper';
|
||||
import screenfull from 'screenfull';
|
||||
import globalize from 'globalize';
|
||||
} from '../../components/htmlMediaHelper';
|
||||
import itemHelper from '../../components/itemHelper';
|
||||
import Screenfull from 'screenfull';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -85,7 +85,7 @@ function tryRemoveElement(elem) {
|
|||
}
|
||||
|
||||
function requireHlsPlayer(callback) {
|
||||
import('hlsjs').then(({default: hls}) => {
|
||||
import('hls.js').then(({default: hls}) => {
|
||||
window.Hls = hls;
|
||||
callback();
|
||||
});
|
||||
|
@ -139,7 +139,7 @@ function tryRemoveElement(elem) {
|
|||
}
|
||||
|
||||
function getDefaultProfile() {
|
||||
return import('browserdeviceprofile').then(({default: profileBuilder}) => {
|
||||
return import('../../scripts/browserDeviceProfile').then(({default: profileBuilder}) => {
|
||||
return profileBuilder({});
|
||||
});
|
||||
}
|
||||
|
@ -323,7 +323,7 @@ function tryRemoveElement(elem) {
|
|||
|
||||
console.debug(`prefetching hls playlist: ${hlsPlaylistUrl}`);
|
||||
|
||||
return window.connectionManager.getApiClient(item.ServerId).ajax({
|
||||
return ConnectionManager.getApiClient(item.ServerId).ajax({
|
||||
|
||||
type: 'GET',
|
||||
url: hlsPlaylistUrl
|
||||
|
@ -362,7 +362,7 @@ function tryRemoveElement(elem) {
|
|||
* @private
|
||||
*/
|
||||
setSrcWithFlvJs(elem, options, url) {
|
||||
return import('flvjs').then(({default: flvjs}) => {
|
||||
return import('flv.js').then(({default: flvjs}) => {
|
||||
const flvPlayer = flvjs.createPlayer({
|
||||
type: 'flv',
|
||||
url: url
|
||||
|
@ -704,8 +704,8 @@ function tryRemoveElement(elem) {
|
|||
dlg.parentNode.removeChild(dlg);
|
||||
}
|
||||
|
||||
if (screenfull.isEnabled) {
|
||||
screenfull.exit();
|
||||
if (Screenfull.isEnabled) {
|
||||
Screenfull.exit();
|
||||
} else {
|
||||
// iOS Safari
|
||||
if (document.webkitIsFullScreen && document.webkitCancelFullscreen) {
|
||||
|
@ -1031,7 +1031,7 @@ function tryRemoveElement(elem) {
|
|||
*/
|
||||
renderSsaAss(videoElement, track, item) {
|
||||
const attachments = this._currentPlayOptions.mediaSource.MediaAttachments || [];
|
||||
const apiClient = window.connectionManager.getApiClient(item);
|
||||
const apiClient = ConnectionManager.getApiClient(item);
|
||||
const htmlVideoPlayer = this;
|
||||
const options = {
|
||||
video: videoElement,
|
||||
|
@ -1058,7 +1058,7 @@ function tryRemoveElement(elem) {
|
|||
resizeVariation: 0.2,
|
||||
renderAhead: 90
|
||||
};
|
||||
import('JavascriptSubtitlesOctopus').then(({default: SubtitlesOctopus}) => {
|
||||
import('libass-wasm').then(({default: SubtitlesOctopus}) => {
|
||||
this.#currentSubtitlesOctopus = new SubtitlesOctopus(options);
|
||||
});
|
||||
}
|
||||
|
@ -1114,7 +1114,7 @@ function tryRemoveElement(elem) {
|
|||
* @private
|
||||
*/
|
||||
setSubtitleAppearance(elem, innerElem) {
|
||||
Promise.all([import('userSettings'), import('subtitleAppearanceHelper')]).then(([userSettings, subtitleAppearanceHelper]) => {
|
||||
Promise.all([import('../../scripts/settings/userSettings'), import('../../components/subtitlesettings/subtitleappearancehelper')]).then(([userSettings, subtitleAppearanceHelper]) => {
|
||||
subtitleAppearanceHelper.applyStyles({
|
||||
text: innerElem,
|
||||
window: elem
|
||||
|
@ -1135,7 +1135,7 @@ function tryRemoveElement(elem) {
|
|||
* @private
|
||||
*/
|
||||
setCueAppearance() {
|
||||
Promise.all([import('userSettings'), import('subtitleAppearanceHelper')]).then(([userSettings, subtitleAppearanceHelper]) => {
|
||||
Promise.all([import('../../scripts/settings/userSettings'), import('../../components/subtitlesettings/subtitleappearancehelper')]).then(([userSettings, subtitleAppearanceHelper]) => {
|
||||
const elementId = `${this.id}-cuestyle`;
|
||||
|
||||
let styleElem = document.querySelector(`#${elementId}`);
|
||||
|
@ -1190,7 +1190,7 @@ function tryRemoveElement(elem) {
|
|||
|
||||
// download the track json
|
||||
this.fetchSubtitles(track, item).then(function (data) {
|
||||
import('userSettings').then((userSettings) => {
|
||||
import('../../scripts/settings/userSettings').then((userSettings) => {
|
||||
// show in ui
|
||||
console.debug(`downloaded ${data.TrackEvents.length} track events`);
|
||||
|
||||
|
@ -1282,7 +1282,7 @@ function tryRemoveElement(elem) {
|
|||
const dlg = document.querySelector('.videoPlayerContainer');
|
||||
|
||||
if (!dlg) {
|
||||
return import('./style').then(() => {
|
||||
return import('./style.css').then(() => {
|
||||
loading.show();
|
||||
|
||||
const dlg = document.createElement('div');
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import pluginManager from 'pluginManager';
|
||||
|
||||
export default function () {
|
||||
const self = this;
|
||||
|
||||
|
@ -128,7 +126,7 @@ export default function () {
|
|||
}
|
||||
|
||||
self.show = function () {
|
||||
import('' + pluginManager.mapPath(self, 'style.css')).then(() => {
|
||||
import('./style.css').then(() => {
|
||||
let elem = document.querySelector('.logoScreenSaver');
|
||||
|
||||
if (!elem) {
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
import { ConnectionManager } from 'jellyfin-apiclient';
|
||||
|
||||
export default class PhotoPlayer {
|
||||
constructor() {
|
||||
|
@ -9,12 +10,12 @@ export default class PhotoPlayer {
|
|||
|
||||
play(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('slideshow').then(({default: slideshow}) => {
|
||||
const index = options.startIndex || 0;
|
||||
import('../../components/slideshow/slideshow').then(({default: Slideshow}) => {
|
||||
var index = options.startIndex || 0;
|
||||
|
||||
const apiClient = window.connectionManager.currentApiClient();
|
||||
var apiClient = ConnectionManager.currentApiClient();
|
||||
apiClient.getCurrentUser().then(function(result) {
|
||||
const newSlideShow = new slideshow({
|
||||
var newSlideShow = new Slideshow({
|
||||
showTitle: false,
|
||||
cover: false,
|
||||
items: options.items,
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import globalize from 'globalize';
|
||||
import { ConnectionManager } from 'jellyfin-apiclient';
|
||||
import globalize from '../../scripts/globalize';
|
||||
|
||||
function showErrorMessage() {
|
||||
return import('alert').then(({default: alert}) => {
|
||||
return import('../../components/alert').then(({default: alert}) => {
|
||||
return alert(globalize.translate('MessagePlayAccessRestricted'));
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +25,7 @@ class PlayAccessValidation {
|
|||
return Promise.resolve();
|
||||
}
|
||||
|
||||
return window.connectionManager.getApiClient(serverId).getCurrentUser().then(function (user) {
|
||||
return ConnectionManager.getApiClient(serverId).getCurrentUser().then(function (user) {
|
||||
if (user.Policy.EnableMediaPlayback) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import playbackManager from 'playbackManager';
|
||||
import events from 'events';
|
||||
import serverNotifications from 'serverNotifications';
|
||||
import { playbackManager } from '../../components/playback/playbackmanager';
|
||||
import { ConnectionManager, events } from 'jellyfin-apiclient';
|
||||
import serverNotifications from '../../scripts/serverNotifications';
|
||||
|
||||
function getActivePlayerId() {
|
||||
const info = playbackManager.getPlayerInfo();
|
||||
|
@ -53,10 +53,10 @@ function getCurrentApiClient(instance) {
|
|||
const currentServerId = instance.currentServerId;
|
||||
|
||||
if (currentServerId) {
|
||||
return window.connectionManager.getApiClient(currentServerId);
|
||||
return ConnectionManager.getApiClient(currentServerId);
|
||||
}
|
||||
|
||||
return window.connectionManager.currentApiClient();
|
||||
return ConnectionManager.currentApiClient();
|
||||
}
|
||||
|
||||
function sendCommandByName(instance, name, options) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import events from 'jellyfin-apiclient';
|
||||
import browser from 'browser';
|
||||
import appRouter from 'appRouter';
|
||||
import { events } from 'jellyfin-apiclient';
|
||||
import browser from '../../scripts/browser';
|
||||
import { appRouter } from '../../components/appRouter';
|
||||
import loading from '../../components/loading/loading';
|
||||
|
||||
/* globals YT */
|
||||
|
@ -20,7 +20,7 @@ function createMediaElement(instance, options) {
|
|||
const dlg = document.querySelector('.youtubePlayerContainer');
|
||||
|
||||
if (!dlg) {
|
||||
import('./style').then(() => {
|
||||
import('./style.css').then(() => {
|
||||
loading.show();
|
||||
|
||||
const dlg = document.createElement('div');
|
||||
|
@ -114,7 +114,7 @@ function onPlaying(instance, playOptions, resolve) {
|
|||
instance.videoDialog.classList.remove('onTop');
|
||||
}
|
||||
|
||||
import('loading').then(({default: loading}) => {
|
||||
import('../../components/loading/loading').then(({default: loading}) => {
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
@ -122,60 +122,58 @@ function onPlaying(instance, playOptions, resolve) {
|
|||
|
||||
function setCurrentSrc(instance, elem, options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('queryString').then(({default: queryString}) => {
|
||||
instance._currentSrc = options.url;
|
||||
const params = queryString.parse(options.url.split('?')[1]);
|
||||
// 3. This function creates an <iframe> (and YouTube player)
|
||||
// after the API code downloads.
|
||||
window.onYouTubeIframeAPIReady = function () {
|
||||
instance.currentYoutubePlayer = new YT.Player('player', {
|
||||
height: instance.videoDialog.offsetHeight,
|
||||
width: instance.videoDialog.offsetWidth,
|
||||
videoId: params.v,
|
||||
events: {
|
||||
'onReady': onPlayerReady,
|
||||
'onStateChange': function (event) {
|
||||
if (event.data === YT.PlayerState.PLAYING) {
|
||||
onPlaying(instance, options, resolve);
|
||||
} else if (event.data === YT.PlayerState.ENDED) {
|
||||
onEndedInternal(instance);
|
||||
} else if (event.data === YT.PlayerState.PAUSED) {
|
||||
events.trigger(instance, 'pause');
|
||||
}
|
||||
instance._currentSrc = options.url;
|
||||
const params = new URLSearchParams(options.url.split('?')[1]); /* eslint-disable-line compat/compat */
|
||||
// 3. This function creates an <iframe> (and YouTube player)
|
||||
// after the API code downloads.
|
||||
window.onYouTubeIframeAPIReady = function () {
|
||||
instance.currentYoutubePlayer = new YT.Player('player', {
|
||||
height: instance.videoDialog.offsetHeight,
|
||||
width: instance.videoDialog.offsetWidth,
|
||||
videoId: params.v,
|
||||
events: {
|
||||
'onReady': onPlayerReady,
|
||||
'onStateChange': function (event) {
|
||||
if (event.data === YT.PlayerState.PLAYING) {
|
||||
onPlaying(instance, options, resolve);
|
||||
} else if (event.data === YT.PlayerState.ENDED) {
|
||||
onEndedInternal(instance);
|
||||
} else if (event.data === YT.PlayerState.PAUSED) {
|
||||
events.trigger(instance, 'pause');
|
||||
}
|
||||
},
|
||||
playerVars: {
|
||||
controls: 0,
|
||||
enablejsapi: 1,
|
||||
modestbranding: 1,
|
||||
rel: 0,
|
||||
showinfo: 0,
|
||||
fs: 0,
|
||||
playsinline: 1
|
||||
}
|
||||
});
|
||||
|
||||
let resizeListener = instance.resizeListener;
|
||||
if (resizeListener) {
|
||||
window.removeEventListener('resize', resizeListener);
|
||||
window.addEventListener('resize', resizeListener);
|
||||
} else {
|
||||
resizeListener = instance.resizeListener = onVideoResize.bind(instance);
|
||||
window.addEventListener('resize', resizeListener);
|
||||
},
|
||||
playerVars: {
|
||||
controls: 0,
|
||||
enablejsapi: 1,
|
||||
modestbranding: 1,
|
||||
rel: 0,
|
||||
showinfo: 0,
|
||||
fs: 0,
|
||||
playsinline: 1
|
||||
}
|
||||
window.removeEventListener('orientationChange', resizeListener);
|
||||
window.addEventListener('orientationChange', resizeListener);
|
||||
};
|
||||
});
|
||||
|
||||
if (!window.YT) {
|
||||
const tag = document.createElement('script');
|
||||
tag.src = 'https://www.youtube.com/iframe_api';
|
||||
const firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
let resizeListener = instance.resizeListener;
|
||||
if (resizeListener) {
|
||||
window.removeEventListener('resize', resizeListener);
|
||||
window.addEventListener('resize', resizeListener);
|
||||
} else {
|
||||
window.onYouTubeIframeAPIReady();
|
||||
resizeListener = instance.resizeListener = onVideoResize.bind(instance);
|
||||
window.addEventListener('resize', resizeListener);
|
||||
}
|
||||
});
|
||||
window.removeEventListener('orientationChange', resizeListener);
|
||||
window.addEventListener('orientationChange', resizeListener);
|
||||
};
|
||||
|
||||
if (!window.YT) {
|
||||
const tag = document.createElement('script');
|
||||
tag.src = 'https://www.youtube.com/iframe_api';
|
||||
const firstScriptTag = document.getElementsByTagName('script')[0];
|
||||
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
|
||||
} else {
|
||||
window.onYouTubeIframeAPIReady();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue