Basic Integration
1. Add the Embed Script
To get your embed script, you will need to go to your TrackPlay dashboard, select the video you want and then go toEmbed section.
You will get a code similar to this:
2. Listen for Player Ready
The TrackPlay script automatically initializes the player and dispatches aTrackPlayReady event when it is ready to use:
Core Event Pattern
All TrackPlay events follow this pattern:Common Events
Here are the most commonly used events:Important Notes
- Always wait for
TrackPlayReady- Do not try to access the player before this event fires - Event data is in
data.detail- All event information is nested under thedetailproperty - One listener per page - You only need one
TrackPlayReadyevent listener per page - Events are configurable - Available events depend on your player configuration
The TrackPlay embed script handles all the heavy lifting - player initialization, responsive sizing, and cross-browser compatibility. You just need to listen for the events you care about!
