This commit is contained in:
Gangphon 2024-03-12 19:06:20 +08:00
parent 92f364cf63
commit 0aa641ec0e
3 changed files with 10 additions and 2 deletions

View File

@ -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);

View File

@ -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<String, SrcVideo> videoMap = new HashMap<>();
@ -511,6 +512,7 @@ public class Prog extends AbsLayout {
}
public static class Page {
String name;
ArrayList<Layer> layers = new ArrayList<>();
ArrayList<Sche> sches;
long endMilli = Long.MAX_VALUE;

View File

@ -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