Skip to content

Commit

Permalink
Server: Move this into a shared package.
Browse files Browse the repository at this point in the history
  • Loading branch information
e3ndr committed Oct 2, 2023
1 parent b3f74fc commit 8ea0053
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.e3ndr.athena.service.http;
package xyz.e3ndr.athena.service;

import java.io.File;
import java.io.IOException;
Expand All @@ -21,8 +21,8 @@
import xyz.e3ndr.athena.types.VideoQuality;
import xyz.e3ndr.athena.types.media.Media;

// Shared with Web UI
public class StreamRoutes implements HttpProvider {
// Used by Http, Simple UI, & Special
public class MediaStreamRoutes implements HttpProvider {

private MediaSession startSession(Media media, Map<String, String> query) throws IOException {
VideoQuality videoQuality = VideoQuality.valueOf(query.getOrDefault("quality", VideoQuality.UHD.name()).toUpperCase());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import lombok.NonNull;
import xyz.e3ndr.athena.Athena;
import xyz.e3ndr.athena.service.AthenaService;
import xyz.e3ndr.athena.service.MediaStreamRoutes;
import xyz.e3ndr.fastloggingframework.logging.FastLogger;
import xyz.e3ndr.fastloggingframework.logging.LogLevel;

Expand Down Expand Up @@ -46,7 +47,7 @@ static class AthenaSoraAdapter extends SoraPlugin {
public void onInit(Sora sora) {
sora.addProvider(this, new MetaRoutes());
sora.addProvider(this, new MediaRoutes());
sora.addProvider(this, new StreamRoutes());
sora.addProvider(this, new MediaStreamRoutes());
sora.addProvider(this, new SessionRoutes());
sora.addProvider(this, new IngestApiRoutes());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import co.casterlabs.sora.api.http.HttpProvider;
import co.casterlabs.sora.api.http.SoraHttpSession;
import co.casterlabs.sora.api.http.annotations.HttpEndpoint;
import xyz.e3ndr.athena.service.http.StreamRoutes;
import xyz.e3ndr.athena.service.MediaStreamRoutes;

class InternalRoutes implements HttpProvider {
private StreamRoutes streamRoutes = new StreamRoutes();
private MediaStreamRoutes streamRoutes = new MediaStreamRoutes();

@HttpEndpoint(uri = "/_internal/media/:mediaId/stream")
public HttpResponse onStreamRAW(SoraHttpSession session) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import co.casterlabs.sora.api.http.HttpProvider;
import co.casterlabs.sora.api.http.SoraHttpSession;
import co.casterlabs.sora.api.http.annotations.HttpEndpoint;
import xyz.e3ndr.athena.service.http.StreamRoutes;
import xyz.e3ndr.athena.service.MediaStreamRoutes;

class InternalRoutes implements HttpProvider {
private StreamRoutes streamRoutes = new StreamRoutes();
private MediaStreamRoutes streamRoutes = new MediaStreamRoutes();

@HttpEndpoint(uri = "/_internal/media/:mediaId/stream")
public HttpResponse onStreamRAW(SoraHttpSession session) {
Expand Down

0 comments on commit 8ea0053

Please sign in to comment.