Stream playback fix
This commit is contained in:
parent
0a3655434b
commit
2418b31a25
|
@ -76,12 +76,12 @@ public class Player {
|
|||
}
|
||||
|
||||
// Precompile VR suffix regex
|
||||
private static final Pattern VR_SUFFIX = Pattern.compile("(_vr)$");
|
||||
// private static final Pattern VR_SUFFIX = Pattern.compile("(_vr)$");
|
||||
|
||||
// Map of host replacements for non-VR streams
|
||||
private static final Map<String, String> HOST_REPLACEMENTS = Map.of(
|
||||
/* private static final Map<String, String> HOST_REPLACEMENTS = Map.of(
|
||||
"media-hls.doppiocdn.com", "media-hls.saawsedge.com"
|
||||
);
|
||||
); */
|
||||
|
||||
/**
|
||||
* Rewrites non-VR doppiocdn.com URLs:
|
||||
|
@ -89,7 +89,7 @@ public class Player {
|
|||
* - strips _vr from directory if present
|
||||
* - forces _480p resolution
|
||||
*/
|
||||
private static String rewriteNonVrStripchatUrl(String url) {
|
||||
/* private static String rewriteNonVrStripchatUrl(String url) {
|
||||
try {
|
||||
URI u = URI.create(url);
|
||||
String host = u.getHost();
|
||||
|
@ -113,7 +113,7 @@ public class Player {
|
|||
log.warn("Failed to rewrite Stripchat URL {}: {}", url, ex.toString());
|
||||
}
|
||||
return url;
|
||||
}
|
||||
} */
|
||||
|
||||
public static boolean play(Model model, boolean async) {
|
||||
try {
|
||||
|
@ -238,6 +238,7 @@ public class Player {
|
|||
}
|
||||
|
||||
String mediaUrlForPlayer = upstreamUrl;
|
||||
if (looksLikeStripchatM3u8(upstreamUrl)) {
|
||||
// if (isVrStripchatStream(upstreamUrl)) {
|
||||
// VR stream -> use proxy
|
||||
proxy = new LocalHlsProxy(model, upstreamUrl);
|
||||
|
@ -246,7 +247,7 @@ public class Player {
|
|||
// } else if (upstreamUrl.contains("doppiocdn.com")) {
|
||||
// Non-VR -> rewrite host + resolution
|
||||
// mediaUrlForPlayer = rewriteNonVrStripchatUrl(upstreamUrl);
|
||||
// }
|
||||
}
|
||||
|
||||
Object[] cmdline = createCmdline(mediaUrlForPlayer, model);
|
||||
log.debug("Player command line: {}", (Object)Arrays.toString(cmdline));
|
||||
|
@ -339,8 +340,8 @@ public class Player {
|
|||
// Only proxy if it's doppiocdn.com AND it's a VR stream (.m3u8 ending + "_vr" somewhere)
|
||||
return host != null
|
||||
&& host.contains("doppiocdn.com")
|
||||
&& path.endsWith(".m3u8")
|
||||
&& path.contains("_vr");
|
||||
&& path.endsWith(".m3u8");
|
||||
// && path.contains("_vr");
|
||||
} catch (Throwable ignore) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue