Support local play when Kodi requires authentication
This commit is contained in:
parent
639162cc06
commit
e2bb7d7c55
|
@ -108,7 +108,9 @@ public class FileDownloadHelper {
|
||||||
|
|
||||||
public String getMediaUrl(HostInfo hostInfo) {
|
public String getMediaUrl(HostInfo hostInfo) {
|
||||||
String pathforUrl = fileName.replaceAll(" ", "%20").replaceAll("'","%27");
|
String pathforUrl = fileName.replaceAll(" ", "%20").replaceAll("'","%27");
|
||||||
String videoUrl = String.format("http://%s:%d/vfs/%s", hostInfo.getAddress(),
|
String credentials = (hostInfo.getPassword() == null || hostInfo.getPassword().isEmpty()) ? "" :
|
||||||
|
String.format("%s:%s@", hostInfo.getUsername(), hostInfo.getPassword());
|
||||||
|
String videoUrl = String.format("http://%s%s:%d/vfs/%s", credentials, hostInfo.getAddress(),
|
||||||
hostInfo.getHttpPort(), pathforUrl);
|
hostInfo.getHttpPort(), pathforUrl);
|
||||||
return videoUrl;
|
return videoUrl;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue