@@ -104,6 +104,34 @@ local function closeAdView(adId, data)
104104 end
105105end
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+
107135local 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 )
154188end
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 ()
0 commit comments