Skip to content

Commit 122e3b9

Browse files
committed
change VideoOSLuaView
1 parent 1703cac commit 122e3b9

File tree

2 files changed

+5
-38
lines changed

2 files changed

+5
-38
lines changed

VideoOS/LuaViewSDK/src/cn/com/venvy/lua/LuaHelper.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ private static void registerNativeLibs(@NonNull LuaView luaView, Platform platfo
7575
getMediaLifeCycleBinder(platform),
7676
getMqttBinder(),
7777
getSvgaBinder(),
78-
getWebViewBinder(),
78+
getWebViewBinder(platform),
7979
getActivityLifeCycleBinder(),
8080
getKeyboardBinder(),
8181
getMediaViewBinder(),
@@ -128,8 +128,10 @@ private static VenvyNativeBinder getNativeBinder(Platform platform, ViewGroup vi
128128
return target;
129129
}
130130

131-
private static VenvyWebViewBinder getWebViewBinder() {
132-
return venvyWebViewBinder == null ? venvyWebViewBinder = new VenvyWebViewBinder() : venvyWebViewBinder;
131+
private static VenvyWebViewBinder getWebViewBinder(Platform platform) {
132+
VenvyWebViewBinder target = venvyWebViewBinder == null ? venvyWebViewBinder = new VenvyWebViewBinder() : venvyWebViewBinder;
133+
target.setPlatform(platform);
134+
return target;
133135
}
134136

135137
private static VenvySvgaBinder getSvgaBinder() {

VideoOS/venvy_pub/src/main/java/cn/com/videopls/pub/view/VideoOSLuaView.java

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ private void callLuaFunction(LuaView luaView, Object object) {
195195
Object dataValue = map.get(key);
196196
if (dataValue != null && dataValue instanceof String) {
197197
dataTable = JsonUtil.toLuaTable((String) dataValue);
198-
if (dataTable != null && dataTable.istable()) {
199-
map.remove(key);
200-
}
201198
}
202199
table = LuaUtil.toTable(map);
203200
if (dataTable != null && table != null && table.istable()) {
@@ -223,34 +220,6 @@ private void runLuaFile(final LuaView luaView, final String luaName, final Objec
223220
} else {
224221
runLua(luaView, luaName, valueData);
225222
}
226-
// VenvyAsyncTaskUtil.doAsyncTask(INIT_SCRIPT,
227-
// new VenvyAsyncTaskUtil.IDoAsyncTask<Object, ScriptBundle>() {
228-
// @Override
229-
// public ScriptBundle doAsyncTask(Object... objects) throws Exception {
230-
// return initScriptBundle(VenvyFileUtil.getCachePath(VideoOSLuaView.this.getContext()) + PreloadLuaUpdate.LUA_CACHE_PATH);
231-
// }
232-
// }, new VenvyAsyncTaskUtil.CommonAsyncCallback<ScriptBundle>() {
233-
// @Override
234-
// public void onPostExecute(ScriptBundle scriptBundle) {
235-
// if (scriptBundle != null) {
236-
// VenvyLog.d("Router", "LuaView begin run and template is " + luaName + ", " +
237-
// "time is " + System.currentTimeMillis());
238-
// luaView.loadScriptBundle(scriptBundle, luaName,
239-
// new LuaCallbackImpl(valueData));
240-
// sScriptBundle = scriptBundle;
241-
// } else {
242-
// runLua(luaView, luaName, valueData);
243-
// }
244-
// }
245-
//
246-
// @Override
247-
// public void onCancelled() {
248-
// }
249-
//
250-
// @Override
251-
// public void onException(Exception ie) {
252-
// }
253-
// });
254223
} else {
255224
luaView.loadScriptBundle(sScriptBundle, luaName, new LuaCallbackImpl(valueData));
256225
}
@@ -260,7 +229,6 @@ private void runLua(final LuaView luaView, final String luaName, final Object va
260229
if (TextUtils.isEmpty(luaName)) {
261230
return;
262231
}
263-
264232
LuaValue table = null;
265233
LuaValue dataTable = null;
266234
String key = "data";
@@ -269,9 +237,6 @@ private void runLua(final LuaView luaView, final String luaName, final Object va
269237
Object dataValue = map.get(key);
270238
if (dataValue != null && dataValue instanceof String) {
271239
dataTable = JsonUtil.toLuaTable((String) dataValue);
272-
if (dataTable != null && dataTable.istable()) {
273-
map.remove(key);
274-
}
275240
}
276241
table = LuaUtil.toTable(map);
277242
if (dataTable != null && table != null && table.istable()) {

0 commit comments

Comments
 (0)