Skip to content

Commit

Permalink
Server: Add some feature detection.
Browse files Browse the repository at this point in the history
This should be regex in a config file somewhere, but it's fine here for now.
  • Loading branch information
e3ndr committed Sep 25, 2023
1 parent 58af857 commit fd42b66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions server/src/main/java/xyz/e3ndr/athena/webui/UIRoutes.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,19 @@ public HttpResponse onWatchSpecificMedia(SoraHttpSession session) {
AudioCodec aCodec = AudioCodec.SOURCE;
VideoQuality quality = VideoQuality.UHD;

String userAgent = session.getHeader("User-Agent");
if (userAgent.contains("Nintendo WiiU")) {
container = ContainerFormat.TS;
vCodec = VideoCodec.H264_BASELINE;
aCodec = AudioCodec.AAC;
quality = VideoQuality.FHD;
} else if (userAgent.contains("Windows Phone") || userAgent.contains("Trident/")) {
container = ContainerFormat.MP4;
vCodec = VideoCodec.H264_BASELINE;
aCodec = AudioCodec.AAC;
quality = VideoQuality.FHD;
}

return new HTMLBuilder()
.f("<a href=\"/media/%s\" onclick=\"history.go(-1); return false;\">Go back</a>", media.getId())
.f("<br />")
Expand Down

0 comments on commit fd42b66

Please sign in to comment.