Skip to main content

destroySDK()

Description

Performs a clean teardown of the SDK, removing all listeners and freeing resources. Call this function when you're done using the SDK.

Usage

m.lib.callFunc("destroySDK")

When to Use

Use this function when:

  • The user exits the event or video
  • Your application is shutting down
  • You need to completely reset the SDK state
  • Navigating away from the video player

Example

' Clean up SDK when exiting event
sub onExitEvent()
' Clean up the SDK
if m.lib <> invalid then
m.lib.callFunc("destroySDK")
m.lib = invalid
end if

' Additional cleanup...
end sub

Best Practices

  • Always call this function before removing the SDK node
  • Ensure proper cleanup to prevent memory leaks
  • Set the library reference to invalid after destroying