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

Merge pull request #1284 from Delgan/es6-modules-components-playback

Migrate components/playback functions to ES6 modules
This commit is contained in:
Anthony Lavado 2020-06-04 13:37:02 -04:00 committed by GitHub
commit b7d05b6097
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 986 additions and 978 deletions

View file

@ -95,8 +95,15 @@
"src/components/images/imageLoader.js", "src/components/images/imageLoader.js",
"src/components/indicators/indicators.js", "src/components/indicators/indicators.js",
"src/components/lazyLoader/lazyLoaderIntersectionObserver.js", "src/components/lazyLoader/lazyLoaderIntersectionObserver.js",
"src/components/playback/brightnessosd.js",
"src/components/playback/mediasession.js", "src/components/playback/mediasession.js",
"src/components/playback/nowplayinghelper.js",
"src/components/playback/playbackorientation.js",
"src/components/playback/playerSelectionMenu.js",
"src/components/playback/playersettingsmenu.js",
"src/components/playback/playmethodhelper.js",
"src/components/playback/remotecontrolautoplay.js", "src/components/playback/remotecontrolautoplay.js",
"src/components/playback/volumeosd.js",
"src/components/playmenu.js", "src/components/playmenu.js",
"src/components/sanatizefilename.js", "src/components/sanatizefilename.js",
"src/components/scrollManager.js", "src/components/scrollManager.js",

View file

@ -1,5 +1,9 @@
define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'material-icons'], function (events, playbackManager, dom, browser) { import events from 'events';
'use strict'; import playbackManager from 'playbackManager';
import dom from 'dom';
import browser from 'browser';
import 'css!./iconosd';
import 'material-icons';
var currentPlayer; var currentPlayer;
var osdElement; var osdElement;
@ -99,9 +103,7 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
} }
function setIcon(iconElement, icon) { function setIcon(iconElement, icon) {
iconElement.classList.remove('brightness_high'); iconElement.classList.remove('brightness_high', 'brightness_medium', 'brightness_low');
iconElement.classList.remove('brightness_medium');
iconElement.classList.remove('brightness_low');
iconElement.classList.add(icon); iconElement.classList.add(icon);
} }
@ -167,5 +169,3 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
}); });
bindToPlayer(playbackManager.getCurrentPlayer()); bindToPlayer(playbackManager.getCurrentPlayer());
});

View file

@ -1,7 +1,4 @@
define([], function () { export function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
'use strict';
function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) {
var topItem = nowPlayingItem; var topItem = nowPlayingItem;
var bottomItem = null; var bottomItem = null;
@ -80,7 +77,6 @@ define([], function () {
return list; return list;
} }
return { export default {
getNowPlayingNames: getNowPlayingNames getNowPlayingNames: getNowPlayingNames
}; };
});

View file

@ -1,5 +1,6 @@
define(['playbackManager', 'layoutManager', 'events'], function (playbackManager, layoutManager, events) { import playbackManager from 'playbackManager';
'use strict'; import layoutManager from 'layoutManager';
import events from 'events';
var orientationLocked; var orientationLocked;
@ -54,4 +55,3 @@ define(['playbackManager', 'layoutManager', 'events'], function (playbackManager
} }
} }
}); });
});

View file

@ -1,5 +1,11 @@
define(['appSettings', 'events', 'browser', 'loading', 'playbackManager', 'appRouter', 'globalize', 'apphost'], function (appSettings, events, browser, loading, playbackManager, appRouter, globalize, appHost) { import appSettings from 'appSettings';
'use strict'; import events from 'events';
import browser from 'browser';
import loading from 'loading';
import playbackManager from 'playbackManager';
import appRouter from 'appRouter';
import globalize from 'globalize';
import appHost from 'apphost';
function mirrorItem(info, player) { function mirrorItem(info, player) {
@ -77,7 +83,7 @@ define(['appSettings', 'events', 'browser', 'loading', 'playbackManager', 'appRo
} }
} }
function showPlayerSelection(button) { export function show(button) {
var currentPlayerInfo = playbackManager.getPlayerInfo(); var currentPlayerInfo = playbackManager.getPlayerInfo();
@ -314,7 +320,6 @@ define(['appSettings', 'events', 'browser', 'loading', 'playbackManager', 'appRo
loading.hide(); loading.hide();
}); });
return { export default {
show: showPlayerSelection show: show
}; };
});

View file

@ -1,5 +1,8 @@
define(['connectionManager', 'actionsheet', 'datetime', 'playbackManager', 'globalize', 'appSettings', 'qualityoptions'], function (connectionManager, actionsheet, datetime, playbackManager, globalize, appSettings, qualityoptions) { import connectionManager from 'connectionManager';
'use strict'; import actionsheet from 'actionsheet';
import playbackManager from 'playbackManager';
import globalize from 'globalize';
import qualityoptions from 'qualityoptions';
function showQualityMenu(player, btn) { function showQualityMenu(player, btn) {
@ -225,7 +228,7 @@ define(['connectionManager', 'actionsheet', 'datetime', 'playbackManager', 'glob
}); });
} }
function show(options) { export function show(options) {
var player = options.player; var player = options.player;
var currentItem = playbackManager.currentItem(player); var currentItem = playbackManager.currentItem(player);
@ -264,7 +267,6 @@ define(['connectionManager', 'actionsheet', 'datetime', 'playbackManager', 'glob
return Promise.reject(); return Promise.reject();
} }
return { export default {
show: show show: show
}; };
});

View file

@ -1,7 +1,4 @@
define([], function () { export function getDisplayPlayMethod(session) {
'use strict';
function getDisplayPlayMethod(session) {
if (!session.NowPlayingItem) { if (!session.NowPlayingItem) {
return null; return null;
@ -18,7 +15,6 @@ define([], function () {
} }
} }
return { export default {
getDisplayPlayMethod: getDisplayPlayMethod getDisplayPlayMethod: getDisplayPlayMethod
}; };
});

View file

@ -1,5 +1,9 @@
define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'material-icons'], function (events, playbackManager, dom, browser) { import events from 'events';
'use strict'; import playbackManager from 'playbackManager';
import dom from 'dom';
import browser from 'browser';
import 'css!./iconosd';
import 'material-icons';
var currentPlayer; var currentPlayer;
var osdElement; var osdElement;
@ -155,5 +159,3 @@ define(['events', 'playbackManager', 'dom', 'browser', 'css!./iconosd', 'materia
}); });
bindToPlayer(playbackManager.getCurrentPlayer()); bindToPlayer(playbackManager.getCurrentPlayer());
});