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