Add constants for app features
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
import DOMPurify from 'dompurify';
|
||||
import debounce from 'lodash-es/debounce';
|
||||
import Screenfull from 'screenfull';
|
||||
|
||||
import { AppFeature } from 'constants/appFeature';
|
||||
import { ServerConnections } from 'lib/jellyfin-apiclient';
|
||||
import { MediaError } from 'types/mediaError';
|
||||
|
||||
import browser from '../../scripts/browser';
|
||||
import appSettings from '../../scripts/settings/appSettings';
|
||||
@@ -27,9 +33,7 @@ import {
|
||||
getBufferedRanges
|
||||
} from '../../components/htmlMediaHelper';
|
||||
import itemHelper from '../../components/itemHelper';
|
||||
import Screenfull from 'screenfull';
|
||||
import globalize from '../../lib/globalize';
|
||||
import { ServerConnections } from 'lib/jellyfin-apiclient';
|
||||
import profileBuilder, { canPlaySecondaryAudio } from '../../scripts/browserDeviceProfile';
|
||||
import { getIncludeCorsCredentials } from '../../scripts/settings/webSettings';
|
||||
import { setBackdropTransparency, TRANSPARENCY_LEVEL } from '../../components/backdrop/backdrop';
|
||||
@@ -37,8 +41,6 @@ import { PluginType } from '../../types/plugin.ts';
|
||||
import Events from '../../utils/events.ts';
|
||||
import { includesAny } from '../../utils/container.ts';
|
||||
import { isHls } from '../../utils/mediaSource.ts';
|
||||
import debounce from 'lodash-es/debounce';
|
||||
import { MediaError } from 'types/mediaError';
|
||||
|
||||
/**
|
||||
* Returns resolved URL.
|
||||
@@ -1667,7 +1669,7 @@ export class HtmlVideoPlayer {
|
||||
const cssClass = 'htmlvideoplayer';
|
||||
|
||||
// Can't autoplay in these browsers so we need to use the full controls, at least until playback starts
|
||||
if (!appHost.supports('htmlvideoautoplay')) {
|
||||
if (!appHost.supports(AppFeature.HtmlVideoAutoplay)) {
|
||||
html += '<video class="' + cssClass + '" preload="metadata" autoplay="autoplay" controls="controls" webkit-playsinline playsinline>';
|
||||
} else if (browser.web0s) {
|
||||
// in webOS, setting preload auto allows resuming videos
|
||||
@@ -1683,7 +1685,7 @@ export class HtmlVideoPlayer {
|
||||
const videoElement = playerDlg.querySelector('video');
|
||||
|
||||
// TODO: Move volume control to PlaybackManager. Player should just be a wrapper that translates commands into API calls.
|
||||
if (!appHost.supports('physicalvolumecontrol')) {
|
||||
if (!appHost.supports(AppFeature.PhysicalVolumeControl)) {
|
||||
videoElement.volume = getSavedVolume();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user