{"id":28490966,"url":"https://github.com/videojs/videojs-errors","last_synced_at":"2026-03-06T18:41:46.011Z","repository":{"id":37574288,"uuid":"8689507","full_name":"videojs/videojs-errors","owner":"videojs","description":"A video.js plugin that displays error messages to video viewers.","archived":false,"fork":false,"pushed_at":"2024-03-16T23:55:31.000Z","size":2814,"stargazers_count":88,"open_issues_count":2,"forks_count":28,"subscribers_count":43,"default_branch":"main","last_synced_at":"2026-01-14T09:04:09.837Z","etag":null,"topics":["errors","html5","javascript","video","video-element","videojs"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/videojs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-10T18:31:15.000Z","updated_at":"2024-09-22T12:48:12.000Z","dependencies_parsed_at":"2023-02-15T09:31:23.683Z","dependency_job_id":"d261cf31-d77b-4f7a-a5f1-feab1f128f4e","html_url":"https://github.com/videojs/videojs-errors","commit_stats":{"total_commits":281,"total_committers":35,"mean_commits":8.028571428571428,"dds":0.7651245551601423,"last_synced_commit":"2b0966fde66d0bd006c647c08114462a17f8b5f7"},"previous_names":["brightcove/videojs-errors"],"tags_count":47,"template":false,"template_full_name":null,"purl":"pkg:github/videojs/videojs-errors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-errors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-errors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-errors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-errors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/videojs","download_url":"https://codeload.github.com/videojs/videojs-errors/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/videojs%2Fvideojs-errors/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30191336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T18:30:16.692Z","status":"ssl_error","status_checked_at":"2026-03-06T18:30:13.818Z","response_time":250,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["errors","html5","javascript","video","video-element","videojs"],"created_at":"2025-06-08T07:30:51.986Z","updated_at":"2026-03-06T18:41:46.006Z","avatar_url":"https://github.com/videojs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# videojs-errors\n\n[![Build Status](https://travis-ci.org/brightcove/videojs-errors.svg?branch=master)](https://travis-ci.org/brightcove/videojs-errors)\n[![Greenkeeper badge](https://badges.greenkeeper.io/brightcove/videojs-errors.svg)](https://greenkeeper.io/)\n[![Slack Status](http://slack.videojs.com/badge.svg)](http://slack.videojs.com)\n\n[![NPM](https://nodei.co/npm/videojs-errors.png?downloads=true\u0026downloadRank=true)](https://nodei.co/npm/videojs-errors/)\n\nA plugin that displays user-friendly messages when Video.js encounters an error.\n\nMaintenance Status: Stable\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n\n- [Getting Started](#getting-started)\n  - [Localization](#localization)\n  - [Supported Errors](#supported-errors)\n  - [Custom Errors](#custom-errors)\n  - [Custom Errors without a Type](#custom-errors-without-a-type)\n  - [`getAll()`](#getall)\n  - [`timeout()`](#timeout)\n  - [`backgroundTimeout()`](#backgroundtimeout)\n- [Known Issues](#known-issues)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n## Getting Started\n**Importing via npm/Babel/Browserify/webpack**\n```shell\nnpm install videojs-errors\n```\n\nThen import in your JavaScript\n```js\nimport videojs from 'video.js';\nimport 'videojs-errors';\n```\n\nInstalling the styles will depend on your build tool.\n[Here's](http://brunch.io/docs/using-modules) an example of including styles with brunch. See Including Module's styles section.\n\n\n**Importing via script tag**\n\nThe plugin automatically registers itself when you include videojs.errors.js in your page:\n\n```html\n\u003cscript src=\"videojs.errors.js\"\u003e\u003c/script\u003e\n```\n\nYou probably want to include the default stylesheet, too. It displays error messages as a semi-transparent overlay on top of the video element itself. It's designed to match up fairly well with the default Video.js styles:\n\n```html\n\u003clink href=\"videojs.errors.css\" rel=\"stylesheet\"\u003e\n```\n\nIf you're not a fan of the default styling, you can drop in your own stylesheet. The only new element to worry about is `vjs-errors-dialog` which is the container for the error messages.\n\n### Localization\nThe plugin supports multiple languages when using Video.JS v4.7.3 or greater. In order to add additional language support, add the language file after your plugin as follows:\n\n```html\n\u003cscript src=\"videojs.errors.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"lang/es.js\"\u003e\u003c/script\u003e\n```\n\n**Note:** A formatted example is available for Spanish under 'lang/es.js'.\n\n### Supported Errors\n\nOnce you've initialized Video.js, you can activate the errors plugin. The plugin has a set of default error messages for the standard HTML5 video errors keyed off their runtime values:\n\n- MEDIA_ERR_ABORTED (numeric value `1`)\n- MEDIA_ERR_NETWORK (numeric value `2`)\n- MEDIA_ERR_DECODE (numeric value `3`)\n- MEDIA_ERR_SRC_NOT_SUPPORTED (numeric value `4`)\n- MEDIA_ERR_ENCRYPTED (numeric value `5`)\n\n### Custom Errors\n\nAdditionally, some custom errors have been added as reference for future extension.\n\n- MEDIA_ERR_UNKNOWN (value `'unknown'`)\n- PLAYER_ERR_NO_SRC (numeric value `-1`)\n- PLAYER_ERR_TIMEOUT (numeric value `-2`)\n- PLAYER_ERR_DOMAIN_RESTRICTED\n- PLAYER_ERR_IP_RESTRICTED\n- PLAYER_ERR_GEO_RESTRICTED\n\n**Note:**\n\n- Custom errors should reference a code value of a string.\n  - Two of the provided errors use negative numbers for historical reasons, but alpha-numeric/descriptive strings are less likely to cause collision issues.\n- Custom errors should have a `type` beginning with `PLAYER_ERR_` versus the standardized `MEDIA_ERR` to avoid confusion.\n- Custom errors can be chosen to be dismissible (boolean value `true`)\n\nIf the video element emits any of those errors, the corresponding error message will be displayed. You can override and add custom error codes by supplying options to the plugin:\n\n```js\nplayer.errors({\n  errors: {\n    3: {\n      headline: 'This is an override for the generic MEDIA_ERR_DECODE',\n      message: 'This is a custom error message'\n    }\n  }\n});\n```\n\nOr by calling `player.errors.extend` _after_ initializing the plugin:\n\n```js\nplayer.errors();\n\nplayer.errors.extend({\n  3: {\n    headline: 'This is an override for the generic MEDIA_ERR_DECODE',\n    message: 'This is a custom error message'\n  },\n  foo: {\n    headline: 'My custom \"foo\" error',\n    message: 'A custom \"foo\" error message.',\n    type: 'PLAYER_ERR_FOO'\n  }\n});\n```\n\nIf you define custom error messages, you'll need to let Video.js know when to emit them yourself:\n\n```js\nplayer.error({code: 'foo', dismiss: true});\n```\n\nIf an error is emitted that doesn't have an associated key, a generic, catch-all message is displayed. You can override that text by supplying a message for the key `unknown`.\n\n### Custom Errors without a Type\n\nAs of v2.0.0, custom errors can be defined without a code. In these cases, the key provided will be used as the code. For example, the custom `foo` error above could be:\n\n```js\nplayer.errors.extend({\n  PLAYER_ERR_FOO: {\n    headline: 'My custom \"foo\" error',\n    message: 'A custom \"foo\" error message.'\n  }\n});\n```\n\nThe difference here being that one would then trigger it via:\n\n```js\nplayer.error({code: 'PLAYER_ERR_FOO'});\n```\n\n### `getAll()`\n\nAfter the errors plugin has been initialized on a player, a `getAll()` method is available on the `errors()` plugin method. This function returns an object with all the errors the plugin currently understands:\n\n```js\nplayer.errors();\n\nvar errors = player.errors.getAll();\n\nconsole.log(errors['1'].type); // \"MEDIA_ERR_ABORTED\"\n```\n\n### `timeout()`\n\nAfter the errors plugin has been initialized on a player, a `timeout()` method is available on the `errors()` plugin method.\n\nA new timeout may be set by passing a timeout in milliseconds, e.g. `player.errors.timeout(5 * 1000)`.\n\nSetting the timeout to `Infinity` or `-1` will turn off this check.\n\nIf no argument is passed, the current timeout value is returned.\n\n### `backgroundTimeout()`\n\nThis functions exactly like [timeout](#timeout) except the default value is 5 minutes.\n\n## Known Issues\n\nOn iPhones, default errors are not dismissible. The video element intercepts all user interaction so error message dialogs miss the tap events. If your video is busted anyways, you may not be that upset about this.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideojs%2Fvideojs-errors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvideojs%2Fvideojs-errors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvideojs%2Fvideojs-errors/lists"}