fix JianPian

pull/290/head
okjack 2 years ago
parent 8eb56482a5
commit 90a95601ce
  1. 11
      app/src/main/java/com/fongmi/android/tv/player/extractor/JianPian.java
  2. 6
      jianpian/src/main/java/com/p2p/P2PClass.java

@ -33,11 +33,13 @@ public class JianPian implements Source.Extractor {
private void start(String url) {
try {
if (path != null) p2p.P2Pdoxdel(path.getBytes("GBK"));
path = URLDecoder.decode(url).split("\\|")[0];
path = path.replace("jianpian://pathtype=url&path=", "");
path = path.replace("tvbox-xg://", "").replace("tvbox-xg:", "");
path = path.replace("xg://", "ftp://").replace("xgplay://", "ftp://");
p2p.P2Pdoxstart(path.getBytes("GBK"));
p2p.P2Pdoxadd(path.getBytes("GBK"));
} catch (Exception e) {
e.printStackTrace();
}
@ -46,7 +48,7 @@ public class JianPian implements Source.Extractor {
@Override
public void stop() {
try {
if (p2p != null) p2p.P2Pdoxpause(path.getBytes("GBK"));
if (p2p != null && path != null) p2p.P2Pdoxpause(path.getBytes("GBK"));
} catch (Exception e) {
e.printStackTrace();
}
@ -54,6 +56,13 @@ public class JianPian implements Source.Extractor {
@Override
public void exit() {
try {
if (p2p != null && path != null) p2p.P2Pdoxpause(path.getBytes("GBK"));
if (p2p != null && path != null) p2p.P2Pdoxdel(path.getBytes("GBK"));
if (p2p != null) p2p.P2Pdoxendhttpd();
} catch (Exception e) {
e.printStackTrace();
}
Path.clear(Path.jpa());
}
}

@ -15,6 +15,10 @@ public class P2PClass {
return doxstarthttpd(bArr, bArr2);
}
public void P2Pdoxendhttpd() {
doxendhttpd();
}
public void P2Pdoxstart(byte[] bArr) {
doxstart(bArr);
}
@ -33,6 +37,8 @@ public class P2PClass {
private native int doxstarthttpd(byte[] bArr, byte[] bArr2);
private native int doxendhttpd();
private native int doxstart(byte[] bArr);
private native int doxadd(byte[] bArr);

Loading…
Cancel
Save