diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java index 86553f3..d545df8 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/MainActivity.java @@ -206,6 +206,11 @@ public class MainActivity extends ComponentActivity implements Choreographer.Fra try { Util.serverURL = connService.getServerURL(); Util.println(" ServerURL: "+Util.serverURL); + if(Util.serverURL==null || Util.serverURL.isEmpty()) Util.serverURL = "https://m2mled.net/"; + else { + if(! Util.serverURL.startsWith("http")) Util.serverURL = "http://"+Util.serverURL; + if(! Util.serverURL.endsWith("/")) Util.serverURL += "/"; + } } catch (Exception e) { Util.makeText(MainActivity.this, Util.toStr(e)).show(); Util.printStackTrace(e); diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java index 124b866..e61a435 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Prog.java @@ -77,6 +77,7 @@ public class Prog extends AbsLayout { var isSimple = _program.intg("version")==2; if(layers==null || layers.isEmpty()) continue; var page = new Page(); + page.name = pageMap.str("name"); page.repeatTimes = pageMap.intg("repeatTimes", 1); page.parse(pageMap.jslist("schedules")); HashMap videoMap = new HashMap<>(); @@ -511,6 +512,7 @@ public class Prog extends AbsLayout { } public static class Page { + String name; ArrayList layers = new ArrayList<>(); ArrayList sches; long endMilli = Long.MAX_VALUE; diff --git a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Server.java b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Server.java index 8f07c06..04ecb81 100644 --- a/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Server.java +++ b/XixunPlayer/app/src/main/java/com/xixun/xixunplayer/Server.java @@ -33,8 +33,9 @@ public class Server extends Service { PlayerInfo.Stub binder = new PlayerInfo.Stub() { @Override public String getProgramName() throws RemoteException { - Util.println("Server getProgramName ..."); - return null; + var name = MainActivity.ins!=null && MainActivity.ins.progView!=null && ! MainActivity.ins.progView.avas.isEmpty() ? MainActivity.ins.page(MainActivity.ins.progView.curAva).name : null; + Util.println("Server getProgramName. <-"+name); + return name; } @Override