From 85adc69a7939419705a5cf51abc954365148acdc Mon Sep 17 00:00:00 2001 From: lastpeony Date: Fri, 8 Mar 2024 13:15:14 +0300 Subject: [PATCH] add new options to app settings basic section: keep all hls files after stream is finished, hls http endpoint configuration --- src/app/app.page/app.definitions.ts | 3 ++ src/app/app.page/app.page.component.html | 56 +++++++++++++++++++++++- src/app/app.page/app.page.component.ts | 49 +++++++++++++++++++++ 3 files changed, 106 insertions(+), 2 deletions(-) diff --git a/src/app/app.page/app.definitions.ts b/src/app/app.page/app.definitions.ts index 2f9d5f9..a1f7fee 100644 --- a/src/app/app.page/app.definitions.ts +++ b/src/app/app.page/app.definitions.ts @@ -199,6 +199,9 @@ export class AppSettings { public hlsListSize: number, public hlsTime: number, public hlsPlayListType: string, + public hlsflags:string, + public hlsHttpEndpoint:string, + public addDateTimeToHlsFileName:boolean, public deleteHLSFilesOnEnded: boolean, public facebookClientId: string, public facebookClientSecret: string, diff --git a/src/app/app.page/app.page.component.html b/src/app/app.page/app.page.component.html index e44f097..6da4d39 100644 --- a/src/app/app.page/app.page.component.html +++ b/src/app/app.page/app.page.component.html @@ -1383,17 +1383,69 @@

+
+
+
+ + + + + +
+
+ +
+
+
+ + +
+ + +
+ +
+
+ + @@ -1576,7 +1628,7 @@

Use Object Detection + If you still have a problem, review FAQ page in antmedia.io/docs"> diff --git a/src/app/app.page/app.page.component.ts b/src/app/app.page/app.page.component.ts index 805afcc..6e493f1 100644 --- a/src/app/app.page/app.page.component.ts +++ b/src/app/app.page/app.page.component.ts @@ -190,6 +190,7 @@ export class AppPageComponent implements OnInit, OnDestroy, AfterViewInit { public clusterNodes: ClusterNode[]; public user: User; public currentClusterNode: string; + public keepAllHlsFilesOnEnded = false; public appSettings: AppSettings; // = new AppSettings(false, true, true, 5, 2, "event", "no clientid", "no fb secret", "no youtube cid", "no youtube secre", "no pers cid", "no pers sec"); @@ -1309,6 +1310,18 @@ export class AppPageComponent implements OnInit, OnDestroy, AfterViewInit { this.restService.getSettings(this.appName).subscribe(data => { this.appSettings = data; this.settingsJson = JSON.stringify(data, null, 2); //JSON.stringify(data); + + if(!this.appSettings.deleteHLSFilesOnEnded && + this.appSettings.hlsPlayListType == "event" && + this.appSettings.hlsflags.includes("append_list") + + ){ + this.keepAllHlsFilesOnEnded = true; + + } + + + if (this.appSettings.jwtControlEnabled) { let jwt = require('jsonwebtoken'); let currentAppJWTToken = jwt.sign({ sub: "token" }, this.appSettings.jwtSecretKey); @@ -2788,6 +2801,42 @@ export class AppPageComponent implements OnInit, OnDestroy, AfterViewInit { } + setKeepAllHlsFilesOnEnded(enabled:boolean){ + this.keepAllHlsFilesOnEnded = enabled; + + if(enabled){ + this.appSettings.deleteHLSFilesOnEnded = false; + this.appSettings.hlsPlayListType = "event" + this.appSettings.hlsflags="+append_list" + this.appSettings.hlsHttpEndpoint="" + this.appSettings.addDateTimeToHlsFileName = false + + }else{ + this.appSettings.hlsflags="+delete_segments" + this.appSettings.hlsPlayListType = "" + } + } + + onKeepAllHlsFilesOnEndedChange(){ + if(this.keepAllHlsFilesOnEnded){ + this.setKeepAllHlsFilesOnEnded(true) + }else{ + this.setKeepAllHlsFilesOnEnded(false) + } + } + + onDeleteHLSFilesOnEndedChange(){ + if(this.appSettings.deleteHLSFilesOnEnded){ + this.setKeepAllHlsFilesOnEnded(false) + } + } + + onHlsHttpEndpointChange(){ + if(this.appSettings.hlsHttpEndpoint){ + this.appSettings.addDateTimeToHlsFileName = true + this.setKeepAllHlsFilesOnEnded(false) + } + } deleteSelectedStreams(): void {