Documentation Index
Fetch the complete documentation index at: https://mintlify.com/lastninja294/adgent-sdk/llms.txt
Use this file to discover all available pages before exploring further.
AdPlayer and AdgentSDK are the same class. AdgentSDK is exported as an alias for convenience. Most users should use AdgentSDK as the primary import.Quick Reference
TheAdPlayer class provides fault-tolerant video ad playback for Smart TV platforms with:
- Nuclear Mute strategy for autoplay compatibility
- Soft-fail autoplay with interactive overlays
- Remote control key handling
- Automatic VAST parsing and tracking
Import
AdgentSDK name is recommended for clarity.
Usage
See the AdgentSDK documentation for complete API reference, constructor parameters, methods, and examples.Example
Implementation Details
Located in:src/core/AdPlayer.ts:38
Nuclear Mute Strategy
The player applies the following attributes to the video element for maximum TV compatibility:src/core/AdPlayer.ts:173 for the complete video element creation logic.
Autoplay Fallback
Whenvideo.play() fails (common on some TV platforms), the player:
- Catches the rejection (src/core/AdPlayer.ts:276)
- Shows an interactive overlay with a play button (src/core/AdPlayer.ts:287)
- Waits for user interaction to start playback
Key Handling
The player captures remote control keys and normalizes them using PlatformAdapter:- Enter: Start ad (if waiting) or skip (if available)
- Back: Close or skip ad
- Play/Pause: Control playback
src/core/AdPlayer.ts:687 for the key action handler.
Constructor
See AdgentSDK ConstructorMethods
| Method | Description | Reference |
|---|---|---|
init() | Initialize SDK and fetch VAST | AdgentSDK.init() |
skip() | Skip the ad | AdgentSDK.skip() |
mute() | Mute video | AdgentSDK.mute() |
unmute() | Unmute video | AdgentSDK.unmute() |
on(listener) | Add event listener | AdgentSDK.on() |
getState() | Get current state | AdgentSDK.getState() |
destroy() | Clean up resources | AdgentSDK.destroy() |
See Also
- AdgentSDK - Full API documentation
- VASTParser - VAST XML parsing
- AdTracker - Tracking pixel firing
- PlatformAdapter - Platform detection
