add stream metadata response from api
This commit is contained in:
@@ -83,6 +83,11 @@ type Marker = {
|
|||||||
timestamp: string,
|
timestamp: string,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type StreamMetadata = {
|
||||||
|
url: string,
|
||||||
|
length: number
|
||||||
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
APIResponse,
|
APIResponse,
|
||||||
VideoMetadata,
|
VideoMetadata,
|
||||||
@@ -92,5 +97,6 @@ export type {
|
|||||||
JobResponse,
|
JobResponse,
|
||||||
StreamStatus,
|
StreamStatus,
|
||||||
StreamHistoryItem,
|
StreamHistoryItem,
|
||||||
Marker
|
Marker,
|
||||||
|
StreamMetadata
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package com.ddf.vodsystem.controllers;
|
package com.ddf.vodsystem.controllers;
|
||||||
|
|
||||||
import com.ddf.vodsystem.controllers.dto.IngestResponse;
|
import com.ddf.vodsystem.controllers.dto.StreamMetadataResponse;
|
||||||
import com.ddf.vodsystem.controllers.dto.StreamResponse;
|
import com.ddf.vodsystem.controllers.dto.StreamResponse;
|
||||||
import com.ddf.vodsystem.dto.APIResponse;
|
import com.ddf.vodsystem.dto.APIResponse;
|
||||||
import com.ddf.vodsystem.entities.Stream;
|
import com.ddf.vodsystem.entities.Stream;
|
||||||
@@ -33,6 +33,9 @@ public class StreamController {
|
|||||||
@Value("${frontend.url:}")
|
@Value("${frontend.url:}")
|
||||||
private String frontendUrl;
|
private String frontendUrl;
|
||||||
|
|
||||||
|
@Value("${stream.max-length}")
|
||||||
|
private Float streamLength;
|
||||||
|
|
||||||
public StreamController(StreamService streamService) {
|
public StreamController(StreamService streamService) {
|
||||||
this.streamService = streamService;
|
this.streamService = streamService;
|
||||||
}
|
}
|
||||||
@@ -66,11 +69,11 @@ public class StreamController {
|
|||||||
return ResponseEntity.ok(new APIResponse<>(SUCCESS, "Stream history retrieved", history));
|
return ResponseEntity.ok(new APIResponse<>(SUCCESS, "Stream history retrieved", history));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/ingest")
|
@GetMapping("/metadata")
|
||||||
public ResponseEntity<APIResponse<IngestResponse>> getIngestEndpoint() {
|
public ResponseEntity<APIResponse<StreamMetadataResponse>> getIngestEndpoint() {
|
||||||
return ResponseEntity.ok(new APIResponse<>(SUCCESS,
|
return ResponseEntity.ok(new APIResponse<>(SUCCESS,
|
||||||
"Ingest endpoint retrieved",
|
"Stream information endpoint retrieved",
|
||||||
new IngestResponse(resolveIngestUrl())));
|
new StreamMetadataResponse(resolveIngestUrl(), streamLength)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package com.ddf.vodsystem.controllers.dto;
|
package com.ddf.vodsystem.controllers.dto;
|
||||||
|
|
||||||
/** Where OBS (or anything else speaking RTMP) should publish to. */
|
/** Where OBS (or anything else speaking RTMP) should publish to. */
|
||||||
public record IngestResponse(String url) {}
|
public record StreamMetadataResponse(String url, Float streamMaxLength) {}
|
||||||
Reference in New Issue
Block a user