Skip to content

Commit 7310526

Browse files
committed
update 2.0.2
1 parent 38ba638 commit 7310526

File tree

4 files changed

+78
-22
lines changed

4 files changed

+78
-22
lines changed

VideoOS/VenvyLibrary/src/main/assets/lua/main.lua

Lines changed: 68 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,34 @@ local function closeAdView(adId, data)
104104
end
105105
end
106106

107+
local function trackNotice(data, requestType, status, isShow)
108+
if (data == nil or requestType == nil or status == nil or isShow == nil) then
109+
return nil
110+
end
111+
112+
-- local OS_HTTP_POST_CHECK_HOTSPOT_TRACK = OS_HTTP_HOST .. "/statisticConfirmLaunch"
113+
114+
-- print("[LuaView] "..paramDataString)
115+
-- print("[LuaView] "..OS_HTTP_POST_CHECK_HOTSPOT_TRACK)
116+
117+
mainNode.request:post(OS_HTTP_POST_CHECK_HOTSPOT_TRACK, {
118+
bu_id = buId,
119+
device_type = deviceType,
120+
videoId = Native:nativeVideoID(),
121+
id = data.id,
122+
launchPlanId = data.launchPlanId,
123+
createId = data.createId,
124+
timestamp = data.videoStartTime,
125+
type = requestType,
126+
status = status,
127+
isShow = isShow,
128+
commonParam = Native:commonParam()
129+
}, function(response, errorInfo)
130+
-- print("luaview getVoteCountInfo")
131+
132+
end)
133+
end
134+
107135
local function checkHotspotShow(data)
108136

109137
if (data == nil) then
@@ -132,24 +160,30 @@ local function checkHotspotShow(data)
132160
data = Native:aesEncrypt(paramDataString, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY)
133161
}, function(response, errorInfo)
134162
-- print("luaview getVoteCountInfo")
135-
if (response == nil) then
136-
return
137-
end
138-
-- print("luaview getVoteCountInfo 11"..Native:tableToJson(response))
139-
responseData = Native:aesDecrypt(response.encryptData, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY)
140-
-- print("luaview " .. Native:tableToJson(data))
141-
-- print("luaview " .. responseData)
142-
response = toTable(responseData)
143-
if (response.resCode ~= "00") then
144-
return
145-
end
146-
147-
if (response.status == "00") then
148-
if checkAdTable[data.id] ~= nil then
149-
checkAdTable[data.id] = true
163+
164+
local requestType = 0
165+
local playStatus = 0
166+
local isShow = 0
167+
if (response ~= nil) then
168+
requestType = 1
169+
-- print("luaview getVoteCountInfo 11"..Native:tableToJson(response))
170+
responseData = Native:aesDecrypt(response.encryptData, OS_HTTP_PUBLIC_KEY, OS_HTTP_PUBLIC_KEY)
171+
-- print("luaview " .. Native:tableToJson(data))
172+
-- print("luaview " .. responseData)
173+
response = toTable(responseData)
174+
if (response.resCode == "00") then
175+
if (response.status == "00") then
176+
playStatus = 1
177+
if checkAdTable[data.id] ~= nil then
178+
checkAdTable[data.id] = true
179+
end
180+
if data.videoStartTime + adShowInterval > lastProgress then
181+
isShow = 1
182+
end
183+
end
150184
end
151185
end
152-
186+
trackNotice(data, requestType, playStatus, isShow)
153187
end)
154188
end
155189

@@ -322,7 +356,17 @@ local function getTaglist()
322356
if (dataTable == nil) then
323357
return
324358
end
325-
--osTypeVideoOS = 1, osTypeLiveOS = 2, 直播开启Mqtt,点播不开启
359+
360+
--下载投放的lua文件
361+
local luaList = {}
362+
for i,v in ipairs(dataTable) do
363+
if (v.luaList ~= nil ) then
364+
table.insert(luaList, v.luaList)
365+
end
366+
end
367+
Native:preloadLuaList(luaList)
368+
369+
--osTypeVideoOS = 1, osTypeLiveOS = 2, 点播按时间点加载,直播直接加载
326370
if Native:osType() < osTypeLiveOS then
327371
print("osTypeVideoOS")
328372
for key, value in pairs(dataTable) do
@@ -440,7 +484,8 @@ local function getResourcelist()
440484
local videoList = {}
441485
local imageList = {}
442486
for i, v in ipairs(dataTable) do
443-
local position = string.find(v, ".mp4", 1)
487+
local lowerUrl = string.lower(v)
488+
local position = string.find(lowerUrl, ".mp4", 1)
444489
if position ~= nil and position > 0 then
445490
table.insert(videoList, v)
446491
else
@@ -498,6 +543,11 @@ function show(args)
498543
if (response.resCode ~= "00") then
499544
return
500545
end
546+
547+
if (response.confirmTime ~= nil) then
548+
adCheckInterval = response.confirmTime * 1000.0
549+
end
550+
501551
mainNode.mqtt = registerMqtt(response)
502552
getTag()
503553
getResourcelist()

VideoOS/VenvyLibrary/src/main/assets/lua/os_string.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ OS_HTTP_POST_MOBILE_QUERY = OS_HTTP_HOST .. "/api/mobileModify"
1212
OS_HTTP_GET_COMMON_QUERY = OS_HTTP_HOST .. "/api/commonQuery"
1313
OS_HTTP_GET_SIMULATION_TAG = OS_HTTP_HOST .. "/simulation/queryInfo"
1414
OS_HTTP_POST_CHECK_HOTSPOT = OS_HTTP_HOST .. "/api/notice"
15+
OS_HTTP_POST_CHECK_HOTSPOT_TRACK = OS_HTTP_HOST .. "/statisticConfirmLaunch"
1516

1617
--数据统计网络相关
1718
OS_HTTP_GET_STARTS = OS_HTTP_HOST .. "/statistic"

VideoOS/VenvyLibrary/src/main/assets/lua/os_util.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ function table_leng(t)
99
end
1010
return leng;
1111
end
12-
function toTable(data) --string json 转table
12+
13+
--string json 转table
14+
function toTable(data)
1315
local dataTable
1416
if (type(data) == 'string') then
1517
if (System.android()) then
@@ -22,6 +24,7 @@ function toTable(data) --string json 转table
2224
end
2325
return dataTable
2426
end
27+
2528
--四舍五入--
2629
function rounded(decimal)
2730
decimal = math.floor(decimal)
@@ -52,6 +55,8 @@ function checkMqttHotspotToSetClose(data, callback)
5255
end
5356
end
5457

58+
59+
--widgetEvent版本兼容
5560
function widgetEvent(eventType, adID, adName, actionType, linkUrl, deepLink, selfLink)
5661

5762
local actionString = ""
@@ -63,7 +68,7 @@ function widgetEvent(eventType, adID, adName, actionType, linkUrl, deepLink, sel
6368
actionString = selfLink
6469
end
6570

66-
if Native.widgetNotifyEvent then
71+
if Native.widgetNotify then
6772

6873
local notifyTable = {}
6974

@@ -87,7 +92,7 @@ function widgetEvent(eventType, adID, adName, actionType, linkUrl, deepLink, sel
8792

8893
Native:widgetNotify(notifyTable)
8994
else
90-
Native:widgetEvent(eventType, id, typeName, actionType, actionString)
95+
Native:widgetEvent(eventType, adID, adName, actionType, actionString)
9196
end
9297
end
9398

VideoOS/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ org.gradle.jvmargs=-Xmx1536m
1515
# This option should only be used with decoupled projects. More details, visit
1616
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1717
# org.gradle.parallel=true
18-
VERSION_NAME = 2.0.0
18+
VERSION_NAME = 2.0.2

0 commit comments

Comments
 (0)