-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ads error interface #568
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
692a891
feat: ads error interface
wseymour15 1224d5e
minor comment changes
wseymour15 fb33c84
update jsdoc
wseymour15 d6cb50e
update error function to handle null
wseymour15 f9b1e45
add tests for error interface
wseymour15 e39e5b9
add error documentation
wseymour15 2a5389f
changes based on comments
wseymour15 b8e79ae
update vjs to 8.11.6
wseymour15 56582d8
additional metadata for resume content error
wseymour15 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 currentAd = player.ads.error(); | ||||||
``` | ||||||
|
||||||
To set the current ads error, the `error` function should be called with a valid error. | ||||||
```js | ||||||
const ad = { errorType: 'ads-error-type' } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
player.ads.error(ad); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` | ||||||
|
||||||
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. | ||||||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.