feat(vods): full vod support on backend and frontend #5
@@ -31,18 +31,20 @@ public class MediaService {
|
|||||||
private static final float CLIP_MAX_LENGTH = 180;
|
private static final float CLIP_MAX_LENGTH = 180;
|
||||||
private static final int HLS_SEGMENT_LENGTH = 3;
|
private static final int HLS_SEGMENT_LENGTH = 3;
|
||||||
private final StreamActionsService streamActionsService;
|
private final StreamActionsService streamActionsService;
|
||||||
|
private final VodService vodService;
|
||||||
|
|
||||||
public MediaService(JobRegistryService jobRegistryService,
|
public MediaService(JobRegistryService jobRegistryService,
|
||||||
DirectoryService directoryService,
|
DirectoryService directoryService,
|
||||||
CompressionService compressionService,
|
CompressionService compressionService,
|
||||||
UserService userService,
|
UserService userService,
|
||||||
ClipService clipService, StreamActionsService streamActionsService) {
|
ClipService clipService, StreamActionsService streamActionsService, VodService vodService) {
|
||||||
this.jobRegistryService = jobRegistryService;
|
this.jobRegistryService = jobRegistryService;
|
||||||
this.directoryService = directoryService;
|
this.directoryService = directoryService;
|
||||||
this.compressionService = compressionService;
|
this.compressionService = compressionService;
|
||||||
this.userService = userService;
|
this.userService = userService;
|
||||||
this.clipService = clipService;
|
this.clipService = clipService;
|
||||||
this.streamActionsService = streamActionsService;
|
this.streamActionsService = streamActionsService;
|
||||||
|
this.vodService = vodService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Job compress(MultipartFile file, ClipOptions clipOptions) throws IOException, InterruptedException {
|
public Job compress(MultipartFile file, ClipOptions clipOptions) throws IOException, InterruptedException {
|
||||||
@@ -132,6 +134,14 @@ public class MediaService {
|
|||||||
job.setDownload(outputFile);
|
job.setDownload(outputFile);
|
||||||
job.setState(JobState.SUCCEEDED);
|
job.setState(JobState.SUCCEEDED);
|
||||||
logger.info("Stream save of job {} succeeded", job.getUuid());
|
logger.info("Stream save of job {} succeeded", job.getUuid());
|
||||||
|
vodService.persist(
|
||||||
|
Instant.now().toString(),
|
||||||
|
"",
|
||||||
|
user,
|
||||||
|
outputFile,
|
||||||
|
outputFile.getFileName().toString()
|
||||||
|
);
|
||||||
|
|
||||||
}).exceptionally(ex -> {
|
}).exceptionally(ex -> {
|
||||||
job.setState(JobState.FAILED);
|
job.setState(JobState.FAILED);
|
||||||
job.setErrorOutput(ex.getMessage());
|
job.setErrorOutput(ex.getMessage());
|
||||||
|
|||||||
Reference in New Issue
Block a user