Im trying to send a NUI callback but it fails every time. On inspecting further via DevTools I found out that NUI post message was not successful returning resource: net::ERR_NAME_NOT_RESOLVED
Im sure there is some silly mistake but Im not able to figure it out.
My LUA code:
call = data.call
task = data.returnTask
if call == "isVideoActive" and task == 'videoGotFucked' then
print(task, "<-------------------------------------")
print("--> Destroying DUI due to video API error")
isDUIActive = false
runLoop = false
shouldDraw = false
exports['mythic_notify']:DoHudText('error', "Unknown error occoured due to API ", { ['background-color'] = '#9C3E3E', ['color'] = '#FFFFFF' })
SetDuiUrl("about:blank")
end
end)
My JS code:
function onPlayerError(event){
console.log(event.data)
console.log("Player Error occoured");
$.post("http://ultra-cinema/returnCall", JSON.stringify({
call: "isVideoActive",
returnTask: "videoGotFucked"
}))
}
The above onPlayerError
is called automatically via yt iframe API