Add convert

pull/137/head
FongMi 3 years ago
parent 8450a2aa06
commit 2a63cd3125
  1. 2
      app/src/main/java/com/fongmi/android/tv/server/Server.java
  2. 1
      app/src/mobile/java/com/fongmi/android/tv/cast/CastVideo.java
  3. 1
      app/src/mobile/java/com/fongmi/android/tv/ui/custom/dialog/CastDialog.java

@ -65,7 +65,7 @@ public class Server {
}
}
private String getIP() {
public String getIP() {
try {
WifiManager manager = (WifiManager) App.get().getApplicationContext().getSystemService(Context.WIFI_SERVICE);
int address = manager.getConnectionInfo().getIpAddress();

@ -19,6 +19,7 @@ public class CastVideo implements ICast {
private CastVideo(String name, String url) {
if (url.startsWith("file")) url = Server.get().getAddress() + "/" + url.replace(Path.rootPath(), "");
if (url.contains("127.0.0.1")) url = url.replace("127.0.0.1", Server.get().getIP());
this.name = name;
this.url = url;
}

@ -69,6 +69,7 @@ public class CastDialog extends BaseDialog implements DeviceAdapter.OnClickListe
public CastDialog history(History history) {
String id = history.getVodId();
String fd = id.startsWith("file") ? Server.get().getAddress() + "/" + id.replace(Path.rootPath(), "") : id;
if (fd.contains("127.0.0.1")) fd = fd.replace("127.0.0.1", Server.get().getIP());
body.add("history", history.toString().replace(id, fd));
return this;
}

Loading…
Cancel
Save