---
metadata:
  - name: generator
    content: Diplodoc Platform v5.34.3
alternate:
  - https://yandex.com/dev/video-sdk/doc/en/sdk-html5/AdViewer-class.md
  - https://yandex.com/dev/video-sdk/doc/ru/sdk-html5/AdViewer-class.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com/dev/video-sdk/doc/en/llms.txt

# AdStore

[Methods](#methods)

## Methods {#methods}

#|
|| **Name** | **Type (Returned)** | **Description** ||
||`createPlaybackController`
`(videoSlot:`
`HTMLVideoElement,` 
`slot: HTMLElement,`
`playbackParameters:`
[`PlaybackParameters`](https://yandex.com/dev/video-sdk/doc/en/sdk-html5/PlaybackParameters-interface.md)
|
[AdPlaybackController](https://yandex.com/dev/video-sdk/doc/en/sdk-html5/AdPlaybackController-class.md) 
|
Creates a controller for one-time ad playback. As a result, an object is returned using which you can control the way ads are played. Method parameters:
* `videoSlot: HTMLVideoElement` — A video element that shows video content. Required parameter.
* `slot: HTMLElement` — An element that shows ad controls. Required parameter.
* `playbackParameters: PlaybackParameters` — Ad playback parameters. Optional parameter. ||
|| `destroy ()` | void
|
Destroys a class instance. If you call this method for `AdStore`, playback is stopped. Controllers that were created with the `.createPlaybackController(...)` method continue playing regardless of whether `AdStore` is destroyed.
||
|| `getNonYandexVastXmlTree` 
|
type VastTree = \{xmlString: string; children: VastTree[]}
|
Retrieves information about the requested VAST or VAST chain.

{% note warning %}

The method doesn't work with ads from the YAN.

{% endnote %} ||
|| `preload (preloadParams:`
[`PreloadParams)`](https://yandex.com/dev/video-sdk/doc/en/sdk-html5/PreloadParams.md)
|
Promise\<void> 
|
Preloads `AdStore` data to speed up running ad creatives. ||
||`showAd (videoSlot:`
`HTMLVideoElement,`
`slot: HTMLElement)`
| 
Promise\<void>
|
Shows ads. Method parameters:
* `videoSlot: HTMLVideoElement` — A video element that shows video content. Required parameter.
* `slot: HTMLElement` — An element that shows ad controls. Required parameter.||
|#
