mirror of
https://github.com/videojs/video.js.git
synced 2025-11-06 09:19:15 +02:00
feat: add option to suppress initial error for non-playable sources (#6057)
Video.js checks whether sources are playable and both displays a message to the user and logs an error to the console. In Google's mobile friendly test and related tools, this message and error is triggered because their test browser's video element does not support any video formats. Some Video.js users are concerned about the æsthetics of the rendered preview within the tools and whether this might have an SEO impact. Adds a suppressNotSupportedError option, defaulting to false. If set to true, if no sources are playable the error is deferred to the first human interaction (click or touchstart) but cleared if a loadstart occurs.
This commit is contained in:
committed by
Gary Katsevman
parent
101b755a7c
commit
5a538c3caf
@@ -35,6 +35,7 @@
|
||||
* [plugins](#plugins)
|
||||
* [responsive](#responsive)
|
||||
* [sources](#sources)
|
||||
* [suppressNotSupportedError](#suppressNotSupportedError)
|
||||
* [techCanOverridePoster](#techcanoverrideposter)
|
||||
* [techOrder](#techorder)
|
||||
* [userActions](#useractions)
|
||||
@@ -374,6 +375,12 @@ Using `<source>` elements will have the same effect:
|
||||
</video>
|
||||
```
|
||||
|
||||
### `suppressNotSupportedError`
|
||||
|
||||
> Type: `boolean`
|
||||
|
||||
If set to true, then the no compatible source error will not be triggered immediately and instead will occur on the first user interaction. This is useful for Google's "mobile friendly" test tool, which can't play video but where you might not want to see an error displayed.
|
||||
|
||||
### `techCanOverridePoster`
|
||||
|
||||
> Type: `boolean`
|
||||
|
||||
Reference in New Issue
Block a user