diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index fd932f88..4416467c 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -146,17 +146,16 @@ class PageController extends Controller public static function provideCommonInitialState(IInitialState &$initialState) { $appManager = \OC::$server->get(\OCP\App\IAppManager::class); - $config = \OC::$server->get(\OCP\IConfig::class); // App version $initialState->provideInitialState('version', $appManager->getAppInfo('memories')['version']); // Video configuration - $initialState->provideInitialState('notranscode', $config->getSystemValue('memories.vod.disable', 'UNSET')); - $initialState->provideInitialState('video_default_quality', $config->getSystemValue('memories.video_default_quality', '0')); + $initialState->provideInitialState('vod_disable', Util::getSystemConfig('memories.vod.disable')); + $initialState->provideInitialState('video_default_quality', Util::getSystemConfig('memories.video_default_quality')); // Geo configuration - $initialState->provideInitialState('places_gis', $config->getSystemValue('memories.gis_type', '-1')); + $initialState->provideInitialState('places_gis', Util::getSystemConfig('memories.gis_type')); } /** diff --git a/src/components/modal/ShareModal.vue b/src/components/modal/ShareModal.vue index 236c4ffa..b72f8b7f 100644 --- a/src/components/modal/ShareModal.vue +++ b/src/components/modal/ShareModal.vue @@ -94,7 +94,7 @@ import LinkIcon from "vue-material-design-icons/LinkVariant.vue"; import FileIcon from "vue-material-design-icons/File.vue"; // Is video transcoding enabled? -const config_noTranscode = loadState("memories", "notranscode", true); +const config_vodDisable = loadState("memories", "vod_disable"); export default defineComponent({ name: "ShareModal", @@ -137,7 +137,7 @@ export default defineComponent({ }, canShareHighRes() { - return !this.isVideo || !config_noTranscode; + return !this.isVideo || !config_vodDisable; }, canShareLink() { diff --git a/src/components/viewer/PsVideo.ts b/src/components/viewer/PsVideo.ts index 688af2b1..322b0d77 100644 --- a/src/components/viewer/PsVideo.ts +++ b/src/components/viewer/PsVideo.ts @@ -23,12 +23,7 @@ type PsVideoEvent = PsEvent & { content: VideoContent; }; -const config_noTranscode = loadState( - "memories", - "notranscode", - "UNSET" -) as boolean | string; -const config_videoIsSetup = config_noTranscode !== "UNSET"; +const config_vodDisable = loadState("memories", "vod_disable"); const config_video_default_quality = Number( loadState("memories", "video_default_quality", "0") as string @@ -145,7 +140,7 @@ class VideoContentSetup { } async initVideo(content: VideoContent) { - if (!isVideoContent(content) || content.videojs || !config_videoIsSetup) { + if (!isVideoContent(content) || content.videojs) { return; } @@ -174,7 +169,7 @@ class VideoContentSetup { type: string; }[] = []; - if (!config_noTranscode) { + if (!config_vodDisable) { sources.push(this.getHLSsrc(content)); } @@ -224,7 +219,7 @@ class VideoContentSetup { directFailed = true; console.warn("PsVideo: Direct video stream could not be opened."); - if (!hlsFailed && !config_noTranscode) { + if (!hlsFailed && !config_vodDisable) { console.warn("PsVideo: Trying HLS stream"); vjs.src(this.getHLSsrc(content)); } @@ -532,7 +527,7 @@ class VideoContentSetup { isKeepingPlaceholder(keep: boolean, content: PsContent) { if (isVideoContent(content)) { - return config_videoIsSetup; + return true; } return keep; } @@ -559,15 +554,6 @@ class VideoContentSetup { content.element = document.createElement("div"); content.element.classList.add("video-container"); - // Stop if video not setup - if (!config_videoIsSetup) { - content.element.innerHTML = t( - "memories", - "Video not configured. Run occ memories:video-setup" - ); - content.element.classList.add("error"); - } - content.onLoaded(); }