Socket
Socket
Sign inDemoInstall

videojs-errors

Package Overview
Dependencies
2
Maintainers
200
Versions
43
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.0.0 to 6.1.0

11

CHANGELOG.md

@@ -0,1 +1,12 @@

<a name="6.1.0"></a>
# [6.1.0](https://github.com/brightcove/videojs-errors/compare/v6.0.0...v6.1.0) (2023-11-01)
### Features
* remove old flash errors ([#238](https://github.com/brightcove/videojs-errors/issues/238)) ([8697517](https://github.com/brightcove/videojs-errors/commit/8697517))
### Bug Fixes
* prevent lint-staged git add warning and mergeOptions warning on Video.js[@8](https://github.com/8) ([#235](https://github.com/brightcove/videojs-errors/issues/235)) ([2b0966f](https://github.com/brightcove/videojs-errors/commit/2b0966f))
<a name="6.0.0"></a>

@@ -2,0 +13,0 @@ # [6.0.0](https://github.com/brightcove/videojs-errors/compare/v5.1.0...v6.0.0) (2022-07-18)

3

dist/lang/es.js

@@ -14,4 +14,3 @@ videojs.addLanguage('es', {

"This video is restricted at your current IP address": "Este vídeo tiene restricciones y no puede reproducirse en su dirección IP actual.",
"This video is restricted from playing in your current geographic region": "Este vídeo tiene restricciones y no puede reproducirse en su región geográfica actual.",
"If you are using an older browser please try upgrading or installing Flash.": "Si está utilizando un navegador antiguo, intente actualizar o instalar Flash."
"This video is restricted from playing in your current geographic region": "Este vídeo tiene restricciones y no puede reproducirse en su región geográfica actual."
});

@@ -14,4 +14,3 @@ {

"This video is restricted at your current IP address": "Este vídeo tiene restricciones y no puede reproducirse en su dirección IP actual.",
"This video is restricted from playing in your current geographic region": "Este vídeo tiene restricciones y no puede reproducirse en su región geográfica actual.",
"If you are using an older browser please try upgrading or installing Flash.": "Si está utilizando un navegador antiguo, intente actualizar o instalar Flash."
"This video is restricted from playing in your current geographic region": "Este vídeo tiene restricciones y no puede reproducirse en su región geográfica actual."
}

@@ -12,4 +12,3 @@ videojs.addLanguage('fr', {

"This video is restricted at your current IP address": "Cette vidéo est restreinte sur votre adresse IP actuelle.",
"This video is restricted from playing in your current geographic region": "La lecture de cette vidéo est restreinte dans votre région géographique.",
"If you are using an older browser please try upgrading or installing Flash.": "Si vous utilisez un navigateur plus ancien, essayez de le mettre à jour ou d’installer Flash."
"This video is restricted from playing in your current geographic region": "La lecture de cette vidéo est restreinte dans votre région géographique."
});

@@ -12,4 +12,3 @@ {

"This video is restricted at your current IP address": "Cette vidéo est restreinte sur votre adresse IP actuelle.",
"This video is restricted from playing in your current geographic region": "La lecture de cette vidéo est restreinte dans votre région géographique.",
"If you are using an older browser please try upgrading or installing Flash.": "Si vous utilisez un navigateur plus ancien, essayez de le mettre à jour ou d’installer Flash."
"This video is restricted from playing in your current geographic region": "La lecture de cette vidéo est restreinte dans votre région géographique."
}

@@ -14,4 +14,3 @@ videojs.addLanguage('gl', {

"This video is restricted at your current IP address": "Este vídeo ten restriccións e non pode reproducirse na súa dirección IP actual.",
"This video is restricted from playing in your current geographic region": "Este vídeo ten restriccións e non pode reproducirse na súa rexión xeográfica actual.",
"If you are using an older browser please try upgrading or installing Flash.": "Se está empregando un navegador antigo, intente actualizar ou instalar Flash."
"This video is restricted from playing in your current geographic region": "Este vídeo ten restriccións e non pode reproducirse na súa rexión xeográfica actual."
});

@@ -14,4 +14,3 @@ {

"This video is restricted at your current IP address": "Este vídeo ten restriccións e non pode reproducirse na súa dirección IP actual.",
"This video is restricted from playing in your current geographic region": "Este vídeo ten restriccións e non pode reproducirse na súa rexión xeográfica actual.",
"If you are using an older browser please try upgrading or installing Flash.": "Se está empregando un navegador antigo, intente actualizar ou instalar Flash."
"This video is restricted from playing in your current geographic region": "Este vídeo ten restriccións e non pode reproducirse na súa rexión xeográfica actual."
}

@@ -15,4 +15,3 @@ videojs.addLanguage('zh-Hant', {

"This video is restricted from playing in your current geographic region": "此視訊遭到限制,無法在您目前的地理區域播放",
"If you are using an older browser please try upgrading or installing Flash.": "如果您是使用舊版的瀏覽器,請嘗試升級或是安裝 Flash。",
"OK": "確定"
});

@@ -15,4 +15,3 @@ {

"This video is restricted from playing in your current geographic region": "此視訊遭到限制,無法在您目前的地理區域播放",
"If you are using an older browser please try upgrading or installing Flash.": "如果您是使用舊版的瀏覽器,請嘗試升級或是安裝 Flash。",
"OK": "確定"
}

@@ -15,4 +15,3 @@ videojs.addLanguage('zh-TW', {

"This video is restricted from playing in your current geographic region": "此視訊遭到限制,無法在您目前的地理區域播放",
"If you are using an older browser please try upgrading or installing Flash.": "如果您是使用舊版的瀏覽器,請嘗試升級或是安裝 Flash。",
"OK": "確定"
});

@@ -15,4 +15,3 @@ {

"This video is restricted from playing in your current geographic region": "此視訊遭到限制,無法在您目前的地理區域播放",
"If you are using an older browser please try upgrading or installing Flash.": "如果您是使用舊版的瀏覽器,請嘗試升級或是安裝 Flash。",
"OK": "確定"
}

@@ -1,2 +0,2 @@

/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */
/*! @name videojs-errors @version 6.1.0 @license Apache-2.0 */
'use strict';

@@ -12,5 +12,5 @@

var version = "6.0.0";
var version = "6.1.0";
const FlashObj = videojs__default["default"].getComponent('Flash');
const merge = videojs__default["default"].obj && videojs__default["default"].obj.merge || videojs__default["default"].merge;
const defaultDismiss = !videojs__default["default"].browser.IS_IPHONE; // Video.js 5/6 cross-compatibility.

@@ -68,5 +68,2 @@

headline: 'This video is restricted from playing in your current geographic region'
},
'FLASHLS_ERR_CROSS_DOMAIN': {
headline: 'The video could not be loaded: crossdomain access denied.'
}

@@ -83,3 +80,3 @@ }

const updateErrors = function (updates) {
options.errors = videojs__default["default"].mergeOptions(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).
options.errors = merge(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).

@@ -167,14 +164,3 @@ Object.keys(options.errors).forEach(k => {

if (!player.error()) {
// error if using Flash and its API is unavailable
const tech = player.$('.vjs-tech');
if (tech && tech.type === 'application/x-shockwave-flash' && !tech.vjs_getProperty) {
player.error({
code: -2,
type: 'PLAYER_ERR_TIMEOUT'
});
return;
} // playback isn't expected if the player is paused
// playback isn't expected if the player is paused
if (player.paused()) {

@@ -246,7 +232,2 @@ return resetMonitor();

if (error.code === 4 && FlashObj && !FlashObj.isSupported()) {
const flashMessage = player.localize('If you are using an older browser please try upgrading or installing Flash.');
details += `<span class="vjs-errors-flashmessage">${flashMessage}</span>`;
}
const display = player.getChild('errorDisplay');

@@ -253,0 +234,0 @@ content.className = 'vjs-errors-dialog';

@@ -1,8 +0,8 @@

/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */
/*! @name videojs-errors @version 6.1.0 @license Apache-2.0 */
import videojs from 'video.js';
import document from 'global/document';
var version = "6.0.0";
var version = "6.1.0";
const FlashObj = videojs.getComponent('Flash');
const merge = videojs.obj && videojs.obj.merge || videojs.merge;
const defaultDismiss = !videojs.browser.IS_IPHONE; // Video.js 5/6 cross-compatibility.

@@ -60,5 +60,2 @@

headline: 'This video is restricted from playing in your current geographic region'
},
'FLASHLS_ERR_CROSS_DOMAIN': {
headline: 'The video could not be loaded: crossdomain access denied.'
}

@@ -75,3 +72,3 @@ }

const updateErrors = function (updates) {
options.errors = videojs.mergeOptions(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).
options.errors = merge(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).

@@ -159,14 +156,3 @@ Object.keys(options.errors).forEach(k => {

if (!player.error()) {
// error if using Flash and its API is unavailable
const tech = player.$('.vjs-tech');
if (tech && tech.type === 'application/x-shockwave-flash' && !tech.vjs_getProperty) {
player.error({
code: -2,
type: 'PLAYER_ERR_TIMEOUT'
});
return;
} // playback isn't expected if the player is paused
// playback isn't expected if the player is paused
if (player.paused()) {

@@ -238,7 +224,2 @@ return resetMonitor();

if (error.code === 4 && FlashObj && !FlashObj.isSupported()) {
const flashMessage = player.localize('If you are using an older browser please try upgrading or installing Flash.');
details += `<span class="vjs-errors-flashmessage">${flashMessage}</span>`;
}
const display = player.getChild('errorDisplay');

@@ -245,0 +226,0 @@ content.className = 'vjs-errors-dialog';

@@ -1,2 +0,2 @@

/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */
/*! @name videojs-errors @version 6.1.0 @license Apache-2.0 */
(function (global, factory) {

@@ -12,5 +12,5 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js')) :

var version = "6.0.0";
var version = "6.1.0";
const FlashObj = videojs__default["default"].getComponent('Flash');
const merge = videojs__default["default"].obj && videojs__default["default"].obj.merge || videojs__default["default"].merge;
const defaultDismiss = !videojs__default["default"].browser.IS_IPHONE; // Video.js 5/6 cross-compatibility.

@@ -68,5 +68,2 @@

headline: 'This video is restricted from playing in your current geographic region'
},
'FLASHLS_ERR_CROSS_DOMAIN': {
headline: 'The video could not be loaded: crossdomain access denied.'
}

@@ -83,3 +80,3 @@ }

const updateErrors = function (updates) {
options.errors = videojs__default["default"].mergeOptions(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).
options.errors = merge(options.errors, updates); // Create `code`s from errors which don't have them (based on their keys).

@@ -167,14 +164,3 @@ Object.keys(options.errors).forEach(k => {

if (!player.error()) {
// error if using Flash and its API is unavailable
const tech = player.$('.vjs-tech');
if (tech && tech.type === 'application/x-shockwave-flash' && !tech.vjs_getProperty) {
player.error({
code: -2,
type: 'PLAYER_ERR_TIMEOUT'
});
return;
} // playback isn't expected if the player is paused
// playback isn't expected if the player is paused
if (player.paused()) {

@@ -246,7 +232,2 @@ return resetMonitor();

if (error.code === 4 && FlashObj && !FlashObj.isSupported()) {
const flashMessage = player.localize('If you are using an older browser please try upgrading or installing Flash.');
details += `<span class="vjs-errors-flashmessage">${flashMessage}</span>`;
}
const display = player.getChild('errorDisplay');

@@ -253,0 +234,0 @@ content.className = 'vjs-errors-dialog';

@@ -1,2 +0,2 @@

/*! @name videojs-errors @version 6.0.0 @license Apache-2.0 */
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsErrors=o(e.videojs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=o(e),i="6.0.0";const n=t.default.getComponent("Flash"),r=!t.default.browser.IS_IPHONE,s=t.default.registerPlugin||t.default.plugin,d={header:"",code:"",message:"",timeout:45e3,backgroundTimeout:3e5,dismiss:r,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"},FLASHLS_ERR_CROSS_DOMAIN:{headline:"The video could not be loaded: crossdomain access denied."}}},a=function(e,o){let r,s,l;const c=[],u=function(e){o.errors=t.default.mergeOptions(o.errors,e),Object.keys(o.errors).forEach((e=>{const t=o.errors[e];t.type||(t.type=e)}))};u();const f=function(){e.error()&&-2===e.error().code&&e.error(null),e.clearTimeout(s),e.clearTimeout(r),l&&(l=!1,e.removeClass("vjs-waiting"));const t=[1/0,-1],i=(e,o)=>-1!==e.indexOf(o);"hidden"===document.visibilityState&&(e.muted()||i(t,o.backgroundTimeout))||"visible"===document.visibilityState&&i(t,o.timeout)||(s=e.setTimeout((function(){e.error()||e.paused()||e.ended()||(l=!0,e.addClass("vjs-waiting"))}),1e3),r=e.setTimeout((function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})}),"hidden"===document.visibilityState?o.backgroundTimeout:o.timeout))},h=function(){let o;for(;c.length;)o=c.shift(),e.off(o[0],o[1]);e.clearTimeout(r),e.clearTimeout(s)},p=function(){let o=0;h(),f(),function(o,t){const i=function(){if(!e.error()){const o=e.$(".vjs-tech");if(o&&"application/x-shockwave-flash"===o.type&&!o.vjs_getProperty)return void e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(e.paused())return f();if(e.ended())return f()}t.call(this)};e.on(o,i),c.push([o,i])}(["timeupdate","adtimeupdate"],(function(){const t=e.currentTime();t!==o&&(o=t,f())})),e.off(document,"visibilitychange",p),e.on(document,"visibilitychange",p)},m=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},v=function(){let i="",r=e.error();const s=document.createElement("div");let d="";if(!r)return;if(e.off(document,"visibilitychange",p),r=t.default.mergeOptions(r,o.errors[r.code||r.type||0]),r.message&&(i=`<div class="vjs-errors-details">${e.localize("Technical details")}\n : <div class="vjs-errors-message">${e.localize(r.message)}</div>\n </div>`),4===r.code&&n&&!n.isSupported()){i+=`<span class="vjs-errors-flashmessage">${e.localize("If you are using an older browser please try upgrading or installing Flash.")}</span>`}const a=e.getChild("errorDisplay");s.className="vjs-errors-dialog";const l=`<div class="vjs-errors-code"><b>${this.localize("Error Code")}:</b> ${r.type||r.code}</div>`,c=-2===r.code;d=`<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">${this.localize(r.headline)}</h2>\n ${c?"":l}\n ${c?"":i}\n </div>`;const u=a.closeable(!("dismiss"in r)||r.dismiss);if(c){d+=`<div class="vjs-errors-timeout-button-container">\n <button>${this.localize("Reload Video")}</button>\n <button>${this.localize("Dismiss")}</button>\n </div>`,s.innerHTML=d,a.fillWith(s),a.getChild("closeButton").hide();const o=a.el().querySelector(".vjs-errors-timeout-button-container > button:first-child"),t=a.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");e.on(o,"click",(function(){const o=e.currentSource();e.reset(),e.src(o)})),e.on(t,"click",(function(){a.close()})),a.one("modalclose",(()=>{e.off(o),e.off(t)}))}else if(u){d+=`<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">${this.localize("OK")}</button>\n </div>`,s.innerHTML=d,a.fillWith(s),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());const o=a.el().querySelector(".vjs-errors-ok-button");e.on(o,"click",(function(){a.close()}))}else s.innerHTML=d,a.fillWith(s);(e.currentWidth()<=600||e.currentHeight()<=250)&&a.addClass("vjs-xs"),a.one("modalclose",(()=>e.error(null)))},y=function(){h(),e.removeClass("vjs-errors"),e.off("play",p),e.off(document,"visibilitychange",p),e.off("play",m),e.off("dispose",y),e.off(["aderror","error"],v)},R=function(o){y(),a(e,t.default.mergeOptions(d,o))};R.extend=e=>u(e),R.getAll=()=>t.default.mergeOptions(o.errors),R.timeout=function(t){if(void 0===t)return o.timeout;t!==o.timeout&&(o.timeout=t,e.paused()||p())},R.backgroundTimeout=function(t){if(void 0===t)return o.backgroundTimeout;t!==o.backgroundTimeout&&(o.backgroundTimeout=t,e.paused()||p())},R.disableProgress=()=>{},e.on("play",p),e.on("play",m),e.on("dispose",y),e.on(["aderror","contenterror","error"],v),e.ready((()=>{e.addClass("vjs-errors")})),e.paused()||p(),R.VERSION=i,e.errors=R},l=function(e){a(this,t.default.mergeOptions(d,e))};return["extend","getAll"].forEach((e=>{l[e]=function(){t.default.log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}})),l.VERSION=i,s("errors",l),l}));
/*! @name videojs-errors @version 6.1.0 @license Apache-2.0 */
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?module.exports=o(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],o):(e="undefined"!=typeof globalThis?globalThis:e||self).videojsErrors=o(e.videojs)}(this,(function(e){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=o(e),i="6.1.0";const n=t.default.obj&&t.default.obj.merge||t.default.merge,r=!t.default.browser.IS_IPHONE,s=t.default.registerPlugin||t.default.plugin,d={header:"",code:"",message:"",timeout:45e3,backgroundTimeout:3e5,dismiss:r,errors:{1:{type:"MEDIA_ERR_ABORTED",headline:"The video download was cancelled"},2:{type:"MEDIA_ERR_NETWORK",headline:"The video connection was lost, please confirm you are connected to the internet"},3:{type:"MEDIA_ERR_DECODE",headline:"The video is bad or in a format that cannot be played on your browser"},4:{type:"MEDIA_ERR_SRC_NOT_SUPPORTED",headline:"This video is either unavailable or not supported in this browser"},5:{type:"MEDIA_ERR_ENCRYPTED",headline:"The video you are trying to watch is encrypted and we do not know how to decrypt it"},unknown:{type:"MEDIA_ERR_UNKNOWN",headline:"An unanticipated problem was encountered, check back soon and try again"},"-1":{type:"PLAYER_ERR_NO_SRC",headline:"No video has been loaded"},"-2":{type:"PLAYER_ERR_TIMEOUT",headline:"It looks like you're having playback issues. Reloading the video may help."},PLAYER_ERR_DOMAIN_RESTRICTED:{headline:"This video is restricted from playing on your current domain"},PLAYER_ERR_IP_RESTRICTED:{headline:"This video is restricted at your current IP address"},PLAYER_ERR_GEO_RESTRICTED:{headline:"This video is restricted from playing in your current geographic region"}}},l=function(e,o){let r,s,a;const c=[],u=function(e){o.errors=n(o.errors,e),Object.keys(o.errors).forEach((e=>{const t=o.errors[e];t.type||(t.type=e)}))};u();const f=function(){e.error()&&-2===e.error().code&&e.error(null),e.clearTimeout(s),e.clearTimeout(r),a&&(a=!1,e.removeClass("vjs-waiting"));const t=[1/0,-1],i=(e,o)=>-1!==e.indexOf(o);"hidden"===document.visibilityState&&(e.muted()||i(t,o.backgroundTimeout))||"visible"===document.visibilityState&&i(t,o.timeout)||(s=e.setTimeout((function(){e.error()||e.paused()||e.ended()||(a=!0,e.addClass("vjs-waiting"))}),1e3),r=e.setTimeout((function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})}),"hidden"===document.visibilityState?o.backgroundTimeout:o.timeout))},h=function(){let o;for(;c.length;)o=c.shift(),e.off(o[0],o[1]);e.clearTimeout(r),e.clearTimeout(s)},m=function(){let o=0;h(),f(),function(o,t){const i=function(){if(!e.error()){if(e.paused())return f();if(e.ended())return f()}t.call(this)};e.on(o,i),c.push([o,i])}(["timeupdate","adtimeupdate"],(function(){const t=e.currentTime();t!==o&&(o=t,f())})),e.off(document,"visibilitychange",m),e.on(document,"visibilitychange",m)},v=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},p=function(){let i="",n=e.error();const r=document.createElement("div");let s="";if(!n)return;e.off(document,"visibilitychange",m),n=t.default.mergeOptions(n,o.errors[n.code||n.type||0]),n.message&&(i=`<div class="vjs-errors-details">${e.localize("Technical details")}\n : <div class="vjs-errors-message">${e.localize(n.message)}</div>\n </div>`);const d=e.getChild("errorDisplay");r.className="vjs-errors-dialog";const l=`<div class="vjs-errors-code"><b>${this.localize("Error Code")}:</b> ${n.type||n.code}</div>`,a=-2===n.code;s=`<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">${this.localize(n.headline)}</h2>\n ${a?"":l}\n ${a?"":i}\n </div>`;const c=d.closeable(!("dismiss"in n)||n.dismiss);if(a){s+=`<div class="vjs-errors-timeout-button-container">\n <button>${this.localize("Reload Video")}</button>\n <button>${this.localize("Dismiss")}</button>\n </div>`,r.innerHTML=s,d.fillWith(r),d.getChild("closeButton").hide();const o=d.el().querySelector(".vjs-errors-timeout-button-container > button:first-child"),t=d.el().querySelector(".vjs-errors-timeout-button-container > button:last-child");e.on(o,"click",(function(){const o=e.currentSource();e.reset(),e.src(o)})),e.on(t,"click",(function(){d.close()})),d.one("modalclose",(()=>{e.off(o),e.off(t)}))}else if(c){s+=`<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">${this.localize("OK")}</button>\n </div>`,r.innerHTML=s,d.fillWith(r),d.contentEl().firstChild.appendChild(d.getChild("closeButton").el());const o=d.el().querySelector(".vjs-errors-ok-button");e.on(o,"click",(function(){d.close()}))}else r.innerHTML=s,d.fillWith(r);(e.currentWidth()<=600||e.currentHeight()<=250)&&d.addClass("vjs-xs"),d.one("modalclose",(()=>e.error(null)))},b=function(){h(),e.removeClass("vjs-errors"),e.off("play",m),e.off(document,"visibilitychange",m),e.off("play",v),e.off("dispose",b),e.off(["aderror","error"],p)},y=function(o){b(),l(e,t.default.mergeOptions(d,o))};y.extend=e=>u(e),y.getAll=()=>t.default.mergeOptions(o.errors),y.timeout=function(t){if(void 0===t)return o.timeout;t!==o.timeout&&(o.timeout=t,e.paused()||m())},y.backgroundTimeout=function(t){if(void 0===t)return o.backgroundTimeout;t!==o.backgroundTimeout&&(o.backgroundTimeout=t,e.paused()||m())},y.disableProgress=()=>{},e.on("play",m),e.on("play",v),e.on("dispose",b),e.on(["aderror","contenterror","error"],p),e.ready((()=>{e.addClass("vjs-errors")})),e.paused()||m(),y.VERSION=i,e.errors=y},a=function(e){l(this,t.default.mergeOptions(d,e))};return["extend","getAll"].forEach((e=>{a[e]=function(){t.default.log.warn(`The errors.${e}() method is not available until the plugin has been initialized!`)}})),a.VERSION=i,s("errors",a),a}));
{
"name": "videojs-errors",
"version": "6.0.0",
"version": "6.1.0",
"author": "Brightcove, Inc.",

@@ -91,10 +91,4 @@ "description": "A Video.js plugin for custom error reporting",

"lint-staged": {
"*.js": [
"vjsstandard --fix",
"git add"
],
"README.md": [
"npm run docs:toc",
"git add"
]
"*.js": "vjsstandard --fix",
"README.md": "npm run docs:toc"
},

@@ -101,0 +95,0 @@ "husky": {

@@ -5,3 +5,4 @@ import videojs from 'video.js';

const FlashObj = videojs.getComponent('Flash');
const merge = (videojs.obj && videojs.obj.merge) || videojs.merge;
const defaultDismiss = !videojs.browser.IS_IPHONE;

@@ -63,5 +64,2 @@

headline: 'This video is restricted from playing in your current geographic region'
},
'FLASHLS_ERR_CROSS_DOMAIN': {
headline: 'The video could not be loaded: crossdomain access denied.'
}

@@ -78,3 +76,3 @@ }

const updateErrors = function(updates) {
options.errors = videojs.mergeOptions(options.errors, updates);
options.errors = merge(options.errors, updates);

@@ -166,15 +164,2 @@ // Create `code`s from errors which don't have them (based on their keys).

if (!player.error()) {
// error if using Flash and its API is unavailable
const tech = player.$('.vjs-tech');
if (tech &&
tech.type === 'application/x-shockwave-flash' &&
!tech.vjs_getProperty) {
player.error({
code: -2,
type: 'PLAYER_ERR_TIMEOUT'
});
return;
}
// playback isn't expected if the player is paused

@@ -252,8 +237,2 @@ if (player.paused()) {

if (error.code === 4 && FlashObj && !FlashObj.isSupported()) {
const flashMessage = player.localize('If you are using an older browser please try upgrading or installing Flash.');
details += `<span class="vjs-errors-flashmessage">${flashMessage}</span>`;
}
const display = player.getChild('errorDisplay');

@@ -260,0 +239,0 @@

@@ -496,26 +496,2 @@ import document from 'global/document';

QUnit.test('Flash API is unavailable when using Flash is an error', function(assert) {
this.player.tech_.el_.type = 'application/x-shockwave-flash';
// when Flash dies the object methods go away
/* eslint-disable camelcase */
this.player.tech_.el_.vjs_getProperty = null;
/* eslint-enable camelcase */
this.player.paused = function() {
return true;
};
let errors = 0;
this.player.on('error', function() {
errors++;
});
this.player.src(sources);
this.player.trigger('play');
this.player.trigger('timeupdate');
assert.strictEqual(errors, 1, 'emitted an error');
assert.strictEqual(this.player.error().code, -2, 'error code is -2');
assert.strictEqual(this.player.error().type, 'PLAYER_ERR_TIMEOUT');
});
QUnit.test(

@@ -814,30 +790,2 @@ 'the plugin cleans up after its previous incarnation when called again',

QUnit.test('Append Flash error details when flash is not supported', function(assert) {
const Flash = videojs.getTech('Flash');
// vjs6 won't have flash by default
if (!Flash) {
assert.notOk(Flash, 'flash tech not available, skipping unit test');
return;
}
const oldIsSupported = videojs.getComponent('Flash').isSupported;
// Mock up isSupported to be false
videojs.getComponent('Flash').isSupported = () => false;
// tick forward enough to ready the player
this.clock.tick(1);
// trigger the error in question
this.player.error(4);
// confirm results
assert.equal(
this.errorDisplay.$('.vjs-errors-flashmessage').textContent,
'If you are using an older browser please try upgrading or installing Flash.',
'Flash Error message should be displayed'
);
// Restoring isSupported to the old value
videojs.getComponent('Flash').isSupported = oldIsSupported;
});
QUnit.test('default error is dismissible', function(assert) {

@@ -844,0 +792,0 @@ // initialize the plugin

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc