1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Update npm

This commit is contained in:
Daniel Neto 2024-04-03 15:54:35 -03:00
parent 8341712d58
commit 1bd85100b9
5320 changed files with 58396 additions and 344722 deletions

View file

@ -75,6 +75,38 @@ if (player.ads.inAdBreak()) {
}
```
### error
Advanced function. Gets, sets, and clears a non-critical ads error in videojs-contrib-ads.
The error will be in the form of an object. This object must contain a `errorType` string, and can also include zero to many custom properties.
```js
{
errorType: 'ads-error-type',
// The key can have any name, and the value can have any type of data.
customData: 'custom-data'
...
}
```
To get the current ads error, the `error` function should be called with no parameters. Returns `null` if there is no error.
```js
const currentAdError = player.ads.error();
```
To set the current ads error, the `error` function should be called with a valid error.
```js
const adError = { errorType: 'ads-error-type' }
player.ads.error(adError);
```
To clear the current ads error, the `error` function should be called with a `null` value.
This value will also be cleared if an invalid error is passed to the function.
```js
player.ads.error(null);
```
## Deprecated
The following are slated for removal from contrib-ads and will have no special behavior once removed. These should no longer be used in integrating ad plugins. Replacements are provided for matching functionality that will continue to be supported.