# Video Integration with VAST The Adhese VAST JS library is designed to make it easy to integrate VAST ads into video players. It includes cross-domain safe methods for requesting ads from your Adhese account and convenient methods for playing and tracking video ads. However, it is not a player on its own and does not insert anything into the DOM. 1. Load the JavaScript file: ```javascript ``` 2. Create an `AdheseVastWrapper` object: ```javascript var wrapper = newAdheseVastWrapper(); ``` 3. Register a listener for the ADS\_LOADED event fired by `AdheseVastWrapper` The first parameter is the event name, and the second is the name of your callback function. This function will be called when the wrapper is ready to handle your ad request. ```javascript wrapper.addEventListener("ADS_LOADED", yourCallBackFunction); ``` 4. Initiate an ad request by providing the host of your Adhese account and the slot path and target parameters you want to request. ```javascript wrapper.requestAds("http://ads.demo.adhese.com", "_test_", ["preroll", "postroll"]); ``` 5. Once the request is finished, `AdheseVastWrapper` will fire the ADS\_LOADED event, and your callback function will be called. From then on, you can access several properties of the wrapper object to get info on the ads. This is a complete example: ```html
The sequence field must be added to the **main structure** of the JSON template. The order logic will not work if the field is added to a nested object within the JSON template. The field will be **stripped from the response** when the Adpod or Stack response is rendered.