Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
SridharaQweebi committed Dec 20, 2024
1 parent 8aa0a75 commit f97059a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sim/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace pxsim.unity {

//% blockId=helloUnity block="helloUnity"
export function helloUnity(){
window.parent.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`)
//window.parent.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`)
const parent = window.parent as Record<string, any>
if (parent && typeof parent.sendMessage === "function") {
// Call the sendMessage function in the parent window
Expand All @@ -46,6 +46,7 @@ namespace pxsim.unity {
else{
console.log("MakeCode: parent is : " + window.parent.document.title);
console.log("MakeCode: parent function not found");
window.postMessage("SendMsg", `SEND_MIXPANEL_EVENT:BtnClickBrowserVideoPlayerClose:VideoId:xx:Timestamp:12`)
}

}
Expand Down

0 comments on commit f97059a

Please sign in to comment.