public async Task CreateApplicationAsync(string applicationName, string server, string host, string storageDirectory) { var request = new CreateApplicationRequest { AppType = "Live", Name = applicationName, ClientStreamReadAccess = "*", ClientStreamWriteAccess = "*", Description = "Video Hearings Application for Audio Recordings", StreamConfig = new StreamConfigurationConfig { CreateStorageDir = true, StreamType = "live-record", StorageDir = $"{storageDirectory}{applicationName}", StorageDirExists = false }, SecurityConfig = new SecurityConfigRequest { PublishBlockDuplicateStreamNames = true, PublishIPWhiteList = "*", } }; var response = await _httpClient.PostAsync ( $"v2/servers/{server}/vhosts/{host}/applications", new StringContent(ApiRequestHelper.SerialiseRequestToCamelCaseJson(request), Encoding.UTF8, "application/json") ); await HandleUnsuccessfulResponse(response); }
public async Task AddStreamRecorderAsync(string applicationName, string server, string host) { var request = new AddStreamRecorderRequest { RecorderName = applicationName, StartOnKeyFrame = true, DefaultRecorder = true, SplitOnTcDiscontinuity = false, OutputPath = "", CurrentFile = "", SegmentationType = "SEGMENT_NONE", FileFormat = "MP4", RecorderState = "", Option = "APPEND_FILE" }; var response = await _httpClient.PostAsync ( $"v2/servers/{server}/vhosts/{host}/applications/" + $"{applicationName}/instances/_definst_/streamrecorders", new StringContent(ApiRequestHelper.SerialiseRequestToCamelCaseJson(request), Encoding.UTF8, "application/json") ); await HandleUnsuccessfulResponse(response); }
public async Task UpdateApplicationAsync(string applicationName, string server, string host, string azureStorageDirectory) { var request = new ApplicationConfigAdvRequest { Modules = new[] { new ModuleConfig { Name = "base", Description = "Base", Class = "com.wowza.wms.module.ModuleCore", Order = 0 }, new ModuleConfig { Name = "logging", Description = "Client Logging", Class = "com.wowza.wms.module.ModuleClientLogging", Order = 1 }, new ModuleConfig { Name = "flvplayback", Description = "FLVPlayback12", Class = "com.wowza.wms.module.ModuleFLVPlayback", Order = 2 }, new ModuleConfig { Name = "ModuleCoreSecurity", Description = "Core Security Module for Applications", Class = "com.wowza.wms.module.ModuleCoreSecurity", Order = 3 }, new ModuleConfig { Name = "ModuleMediaWriterFileMover", Description = "ModuleMediaWriterFileMover", Class = "com.wowza.wms.module.ModuleMediaWriterFileMover", Order = 4 }, new ModuleConfig { Name = "ModuleAutoRecord", Description = "ModuleAutoRecord", Class = "com.wowza.wms.plugin.ModuleAutoRecord", Order = 5 } }, AdvancedSettings = new[] { new AdvancedSetting { SectionName = "Application", Section = "/Root/Application", Name = "fileMoverDestinationPath", Type = "String", Value = azureStorageDirectory, Documented = false, Enabled = true }, new AdvancedSetting { SectionName = "Application", Section = "/Root/Application", Name = "fileMoverDeleteOriginal", Type = "Boolean", Value = "false", Documented = false, Enabled = true }, new AdvancedSetting { SectionName = "Application", Section = "/Root/Application", Name = "fileMoverVersionFile", Type = "Boolean", Value = "false", Documented = false, Enabled = true } } }; var response = await _httpClient.PostAsync ( $"v2/servers/{server}/vhosts/{host}/applications/{applicationName}/adv", new StringContent(ApiRequestHelper.SerialiseRequestToCamelCaseJson(request), Encoding.UTF8, "application/json") ); await HandleUnsuccessfulResponse(response); }