mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-06-03 00:58:06 -04:00
move playurl fallback
This commit is contained in:
parent
fdbfd10d84
commit
e50210fd12
@ -219,22 +219,22 @@ public class JfClient {
|
|||||||
if (mediaSources != null && mediaSources.size() > 0) {
|
if (mediaSources != null && mediaSources.size() > 0) {
|
||||||
JsonObject mediaSource = mediaSources.get(0).getAsJsonObject();
|
JsonObject mediaSource = mediaSources.get(0).getAsJsonObject();
|
||||||
String transcodingUrl = mediaSource.get("TranscodingUrl").getAsString();
|
String transcodingUrl = mediaSource.get("TranscodingUrl").getAsString();
|
||||||
|
|
||||||
// 检查TranscodingUrl是否为空
|
// 检查TranscodingUrl是否为空
|
||||||
if (transcodingUrl != null && !transcodingUrl.isEmpty()) {
|
if (transcodingUrl != null && !transcodingUrl.isEmpty()) {
|
||||||
playurl = config.getJellyfinUrl() + transcodingUrl;
|
playurl = config.getJellyfinUrl() + transcodingUrl;
|
||||||
} else {
|
|
||||||
playurl = config.getJellyfinUrl() + "/videos/" + itemid + "/stream.mp4?static=true&DeviceId=" + DeviceId + "&api_key=" + AccessToken;
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
playurl = config.getJellyfinUrl() + "/videos/" + itemid + "/stream.mp4?static=true&DeviceId=" + DeviceId + "&api_key=" + AccessToken;
|
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
playurl = config.getJellyfinUrl() + "/videos/" + itemid + "/stream.mp4?static=true&DeviceId=" + DeviceId + "&api_key=" + AccessToken;
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
|
|
||||||
|
// if playurl is still "", return config.getJellyfinUrl() + "/videos/" + itemid + "/stream.mp4?static=true&DeviceId=" + DeviceId + "&api_key=" + AccessToken;
|
||||||
|
if (playurl == null || playurl.isEmpty()) {
|
||||||
|
playurl = config.getJellyfinUrl() + "/videos/" + itemid + "/stream.mp4?static=true&DeviceId=" + DeviceId + "&api_key=" + AccessToken;
|
||||||
|
}
|
||||||
|
|
||||||
return playurl; // Return the playurl variable
|
return playurl; // Return the playurl variable
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user