notranscode: remove error on UI

Signed-off-by: Varun Patil <varunpatil@ucla.edu>
pull/563/head
Varun Patil 2023-04-10 14:13:21 -07:00
parent 5c5eef1ff4
commit 8cdfe0a97e
3 changed files with 10 additions and 25 deletions

View File

@ -146,17 +146,16 @@ class PageController extends Controller
public static function provideCommonInitialState(IInitialState &$initialState) public static function provideCommonInitialState(IInitialState &$initialState)
{ {
$appManager = \OC::$server->get(\OCP\App\IAppManager::class); $appManager = \OC::$server->get(\OCP\App\IAppManager::class);
$config = \OC::$server->get(\OCP\IConfig::class);
// App version // App version
$initialState->provideInitialState('version', $appManager->getAppInfo('memories')['version']); $initialState->provideInitialState('version', $appManager->getAppInfo('memories')['version']);
// Video configuration // Video configuration
$initialState->provideInitialState('notranscode', $config->getSystemValue('memories.vod.disable', 'UNSET')); $initialState->provideInitialState('vod_disable', Util::getSystemConfig('memories.vod.disable'));
$initialState->provideInitialState('video_default_quality', $config->getSystemValue('memories.video_default_quality', '0')); $initialState->provideInitialState('video_default_quality', Util::getSystemConfig('memories.video_default_quality'));
// Geo configuration // Geo configuration
$initialState->provideInitialState('places_gis', $config->getSystemValue('memories.gis_type', '-1')); $initialState->provideInitialState('places_gis', Util::getSystemConfig('memories.gis_type'));
} }
/** /**

View File

@ -94,7 +94,7 @@ import LinkIcon from "vue-material-design-icons/LinkVariant.vue";
import FileIcon from "vue-material-design-icons/File.vue"; import FileIcon from "vue-material-design-icons/File.vue";
// Is video transcoding enabled? // Is video transcoding enabled?
const config_noTranscode = loadState("memories", "notranscode", true); const config_vodDisable = loadState("memories", "vod_disable");
export default defineComponent({ export default defineComponent({
name: "ShareModal", name: "ShareModal",
@ -137,7 +137,7 @@ export default defineComponent({
}, },
canShareHighRes() { canShareHighRes() {
return !this.isVideo || !config_noTranscode; return !this.isVideo || !config_vodDisable;
}, },
canShareLink() { canShareLink() {

View File

@ -23,12 +23,7 @@ type PsVideoEvent = PsEvent & {
content: VideoContent; content: VideoContent;
}; };
const config_noTranscode = loadState( const config_vodDisable = loadState("memories", "vod_disable");
"memories",
"notranscode",
<string>"UNSET"
) as boolean | string;
const config_videoIsSetup = config_noTranscode !== "UNSET";
const config_video_default_quality = Number( const config_video_default_quality = Number(
loadState("memories", "video_default_quality", <string>"0") as string loadState("memories", "video_default_quality", <string>"0") as string
@ -145,7 +140,7 @@ class VideoContentSetup {
} }
async initVideo(content: VideoContent) { async initVideo(content: VideoContent) {
if (!isVideoContent(content) || content.videojs || !config_videoIsSetup) { if (!isVideoContent(content) || content.videojs) {
return; return;
} }
@ -174,7 +169,7 @@ class VideoContentSetup {
type: string; type: string;
}[] = []; }[] = [];
if (!config_noTranscode) { if (!config_vodDisable) {
sources.push(this.getHLSsrc(content)); sources.push(this.getHLSsrc(content));
} }
@ -224,7 +219,7 @@ class VideoContentSetup {
directFailed = true; directFailed = true;
console.warn("PsVideo: Direct video stream could not be opened."); console.warn("PsVideo: Direct video stream could not be opened.");
if (!hlsFailed && !config_noTranscode) { if (!hlsFailed && !config_vodDisable) {
console.warn("PsVideo: Trying HLS stream"); console.warn("PsVideo: Trying HLS stream");
vjs.src(this.getHLSsrc(content)); vjs.src(this.getHLSsrc(content));
} }
@ -532,7 +527,7 @@ class VideoContentSetup {
isKeepingPlaceholder(keep: boolean, content: PsContent) { isKeepingPlaceholder(keep: boolean, content: PsContent) {
if (isVideoContent(content)) { if (isVideoContent(content)) {
return config_videoIsSetup; return true;
} }
return keep; return keep;
} }
@ -559,15 +554,6 @@ class VideoContentSetup {
content.element = document.createElement("div"); content.element = document.createElement("div");
content.element.classList.add("video-container"); 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(); content.onLoaded();
} }