videojs-errors
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -9,2 +9,5 @@ CHANGELOG | ||
## 1.3.2 (2017-04-24) | ||
* @forbesjo Added option to disable watching progress events ([#91](https://github.com/brightcove/videojs-errors/pull/91)) | ||
## 1.3.1 (2017-04-19) | ||
@@ -11,0 +14,0 @@ * @misteroneill Fix size detection to account for players that have no configured dimensions ([#92](https://github.com/brightcove/videojs-errors/pull/92)) |
/*! | ||
* @name videojs-errors | ||
* @version 1.3.1 | ||
* @version 1.3.2 | ||
* @author Brightcove, Inc. | ||
@@ -13,6 +13,8 @@ * @license Apache-2.0 | ||
var doccy; | ||
if (typeof document !== 'undefined') { | ||
module.exports = document; | ||
doccy = document; | ||
} else { | ||
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
@@ -22,6 +24,6 @@ if (!doccy) { | ||
} | ||
module.exports = doccy; | ||
} | ||
module.exports = doccy; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -31,12 +33,16 @@ | ||
(function (global){ | ||
var win; | ||
if (typeof window !== "undefined") { | ||
module.exports = window; | ||
win = window; | ||
} else if (typeof global !== "undefined") { | ||
module.exports = global; | ||
win = global; | ||
} else if (typeof self !== "undefined"){ | ||
module.exports = self; | ||
win = self; | ||
} else { | ||
module.exports = {}; | ||
win = {}; | ||
} | ||
module.exports = win; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -73,2 +79,3 @@ | ||
dismiss: defaultDismiss, | ||
progressDisabled: false, | ||
errors: { | ||
@@ -215,3 +222,6 @@ '1': { | ||
}); | ||
healthcheck('progress', resetMonitor); | ||
if (!options.progressDisabled) { | ||
healthcheck('progress', resetMonitor); | ||
} | ||
}; | ||
@@ -306,2 +316,7 @@ | ||
reInitPlugin.disableProgress = function (disabled) { | ||
options.progressDisabled = disabled; | ||
onPlayStartMonitor(); | ||
}; | ||
player.on('play', onPlayStartMonitor); | ||
@@ -308,0 +323,0 @@ player.on('play', onPlayNoSource); |
/*! | ||
* @name videojs-errors | ||
* @version 1.3.1 | ||
* @version 1.3.2 | ||
* @author Brightcove, Inc. | ||
* @license Apache-2.0 | ||
*/ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.videojsErrors=e()}}(function(){return function e(o,n,r){function i(s,d){if(!n[s]){if(!o[s]){var l="function"==typeof require&&require;if(!d&&l)return l(s,!0);if(t)return t(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n||e)},f,f.exports,e,o,n,r)}return n[s].exports}for(var t="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,o,n){(function(n){var r=void 0!==n?n:"undefined"!=typeof window?window:{},i=e(3);if("undefined"!=typeof document)o.exports=document;else{var t=r["__GLOBAL_DOCUMENT_CACHE@4"];t||(t=r["__GLOBAL_DOCUMENT_CACHE@4"]=i),o.exports=t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{3:3}],2:[function(e,o,n){(function(e){"undefined"!=typeof window?o.exports=window:void 0!==e?o.exports=e:"undefined"!=typeof self?o.exports=self:o.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,o,n){},{}],4:[function(e,o,n){(function(n){"use strict";function r(e){return e&&"object"===(void 0===e?"undefined":i(e))&&"default"in e?e["default"]:e}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=r(void 0!==s?s.videojs:void 0!==n?n.videojs:null),s=r(e(2)),d=r(e(1)),l=t.getComponent("Flash"),a=!t.browser.IS_IPHONE,f=t.registerPlugin||t.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:a,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:"Could not download the video"},"-3":{type:"PLAYER_ERR_DOMAIN_RESTRICTED",headline:"This video is restricted from playing on your current domain"},"-4":{type:"PLAYER_ERR_IP_RESTRICTED",headline:"This video is restricted at your current IP address"},"-5":{type:"PLAYER_ERR_GEO_RESTRICTED",headline:"This video is restricted from playing in your current geographic region"}}},c=function y(e,o){var n=void 0,r=[],i=function(){s.clearTimeout(n),n=s.setTimeout(function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},o.timeout),e.error()&&-2===e.error().code&&e.error(null)},a=function(){for(var o=void 0;r.length;)o=r.shift(),e.off(o[0],o[1]);s.clearTimeout(n)},f=function(o,n){var t=function(){if(!e.error()){var 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 i();if(e.ended())return i()}n.call(this)};e.on(o,t),r.push([o,t])},c=function(){var o=0;a(),i(),f(["timeupdate","adtimeupdate"],function(){var n=e.currentTime();n!==o&&(o=n,i())}),f("progress",i)},p=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},v=function(){var n="",r=e.error(),i=d.createElement("div"),s="";if(r){if(r=t.mergeOptions(r,o.errors[r.code||0]),r.message&&(n='<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&&l&&!l.isSupported()){n+='<span class="vjs-errors-flashmessage">'+e.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>"}var a=e.getChild("errorDisplay");i.className="vjs-errors-dialog",i.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(r.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(r.type||r.code)+"</div>\n "+n+"\n </div>";if(a.closeable(!("dismiss"in r)||r.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",i.innerHTML=s,a.fillWith(i),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());var f=a.el().querySelector(".vjs-errors-ok-button");e.on(f,"click",function(){a.close()})}else i.innerHTML=s,a.fillWith(i);(e.currentWidth()<=600||e.currentHeight()<=250)&&a.addClass("vjs-xs"),a.one("modalclose",function(){return e.error(null)})}},h=function R(){a(),e.removeClass("vjs-errors"),e.off("play",c),e.off("play",p),e.off("dispose",R),e.off("error",v)},E=function(o){h(),y(e,t.mergeOptions(u,o))};E.extend=function(e){o.errors=t.mergeOptions(o.errors,e)},e.on("play",c),e.on("play",p),e.on("dispose",h),e.on("error",v),e.ready(function(){e.addClass("vjs-errors")}),e.errors=E},p=function(e){c(this,t.mergeOptions(u,e))};f("errors",p),o.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,2:2}]},{},[4])(4)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.videojsErrors=e()}}(function(){return function e(o,n,r){function i(s,d){if(!n[s]){if(!o[s]){var l="function"==typeof require&&require;if(!d&&l)return l(s,!0);if(t)return t(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n||e)},f,f.exports,e,o,n,r)}return n[s].exports}for(var t="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,o,n){(function(n){var r,i=void 0!==n?n:"undefined"!=typeof window?window:{},t=e(3);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=t),o.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{3:3}],2:[function(e,o,n){(function(e){var n;n="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},o.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,o,n){},{}],4:[function(e,o,n){(function(n){"use strict";function r(e){return e&&"object"===(void 0===e?"undefined":i(e))&&"default"in e?e["default"]:e}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=r(void 0!==s?s.videojs:void 0!==n?n.videojs:null),s=r(e(2)),d=r(e(1)),l=t.getComponent("Flash"),a=!t.browser.IS_IPHONE,f=t.registerPlugin||t.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:a,progressDisabled:!1,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:"Could not download the video"},"-3":{type:"PLAYER_ERR_DOMAIN_RESTRICTED",headline:"This video is restricted from playing on your current domain"},"-4":{type:"PLAYER_ERR_IP_RESTRICTED",headline:"This video is restricted at your current IP address"},"-5":{type:"PLAYER_ERR_GEO_RESTRICTED",headline:"This video is restricted from playing in your current geographic region"}}},c=function y(e,o){var n=void 0,r=[],i=function(){s.clearTimeout(n),n=s.setTimeout(function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},o.timeout),e.error()&&-2===e.error().code&&e.error(null)},a=function(){for(var o=void 0;r.length;)o=r.shift(),e.off(o[0],o[1]);s.clearTimeout(n)},f=function(o,n){var t=function(){if(!e.error()){var 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 i();if(e.ended())return i()}n.call(this)};e.on(o,t),r.push([o,t])},c=function(){var n=0;a(),i(),f(["timeupdate","adtimeupdate"],function(){var o=e.currentTime();o!==n&&(n=o,i())}),o.progressDisabled||f("progress",i)},p=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},v=function(){var n="",r=e.error(),i=d.createElement("div"),s="";if(r){if(r=t.mergeOptions(r,o.errors[r.code||0]),r.message&&(n='<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&&l&&!l.isSupported()){n+='<span class="vjs-errors-flashmessage">'+e.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>"}var a=e.getChild("errorDisplay");i.className="vjs-errors-dialog",i.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(r.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(r.type||r.code)+"</div>\n "+n+"\n </div>";if(a.closeable(!("dismiss"in r)||r.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",i.innerHTML=s,a.fillWith(i),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());var f=a.el().querySelector(".vjs-errors-ok-button");e.on(f,"click",function(){a.close()})}else i.innerHTML=s,a.fillWith(i);(e.currentWidth()<=600||e.currentHeight()<=250)&&a.addClass("vjs-xs"),a.one("modalclose",function(){return e.error(null)})}},h=function R(){a(),e.removeClass("vjs-errors"),e.off("play",c),e.off("play",p),e.off("dispose",R),e.off("error",v)},E=function(o){h(),y(e,t.mergeOptions(u,o))};E.extend=function(e){o.errors=t.mergeOptions(o.errors,e)},E.disableProgress=function(e){o.progressDisabled=e,c()},e.on("play",c),e.on("play",p),e.on("dispose",h),e.on("error",v),e.ready(function(){e.addClass("vjs-errors")}),e.errors=E},p=function(e){c(this,t.mergeOptions(u,e))};f("errors",p),o.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,2:2}]},{},[4])(4)}); | ||
//# sourceMappingURL=videojs-errors.min.js.map |
/*! | ||
* @name videojs-errors | ||
* @version 1.3.1 | ||
* @version 1.3.2 | ||
* @author Brightcove, Inc. | ||
@@ -13,6 +13,8 @@ * @license Apache-2.0 | ||
var doccy; | ||
if (typeof document !== 'undefined') { | ||
module.exports = document; | ||
doccy = document; | ||
} else { | ||
var doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; | ||
@@ -22,6 +24,6 @@ if (!doccy) { | ||
} | ||
module.exports = doccy; | ||
} | ||
module.exports = doccy; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -31,12 +33,16 @@ | ||
(function (global){ | ||
var win; | ||
if (typeof window !== "undefined") { | ||
module.exports = window; | ||
win = window; | ||
} else if (typeof global !== "undefined") { | ||
module.exports = global; | ||
win = global; | ||
} else if (typeof self !== "undefined"){ | ||
module.exports = self; | ||
win = self; | ||
} else { | ||
module.exports = {}; | ||
win = {}; | ||
} | ||
module.exports = win; | ||
}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) | ||
@@ -73,2 +79,3 @@ | ||
dismiss: defaultDismiss, | ||
progressDisabled: false, | ||
errors: { | ||
@@ -215,3 +222,6 @@ '1': { | ||
}); | ||
healthcheck('progress', resetMonitor); | ||
if (!options.progressDisabled) { | ||
healthcheck('progress', resetMonitor); | ||
} | ||
}; | ||
@@ -306,2 +316,7 @@ | ||
reInitPlugin.disableProgress = function (disabled) { | ||
options.progressDisabled = disabled; | ||
onPlayStartMonitor(); | ||
}; | ||
player.on('play', onPlayStartMonitor); | ||
@@ -308,0 +323,0 @@ player.on('play', onPlayNoSource); |
/*! | ||
* @name videojs-errors | ||
* @version 1.3.1 | ||
* @version 1.3.2 | ||
* @author Brightcove, Inc. | ||
* @license Apache-2.0 | ||
*/ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.videojsErrors=e()}}(function(){return function e(o,n,r){function i(s,d){if(!n[s]){if(!o[s]){var l="function"==typeof require&&require;if(!d&&l)return l(s,!0);if(t)return t(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n||e)},f,f.exports,e,o,n,r)}return n[s].exports}for(var t="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,o,n){(function(n){var r=void 0!==n?n:"undefined"!=typeof window?window:{},i=e(3);if("undefined"!=typeof document)o.exports=document;else{var t=r["__GLOBAL_DOCUMENT_CACHE@4"];t||(t=r["__GLOBAL_DOCUMENT_CACHE@4"]=i),o.exports=t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{3:3}],2:[function(e,o,n){(function(e){"undefined"!=typeof window?o.exports=window:void 0!==e?o.exports=e:"undefined"!=typeof self?o.exports=self:o.exports={}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,o,n){},{}],4:[function(e,o,n){(function(n){"use strict";function r(e){return e&&"object"===(void 0===e?"undefined":i(e))&&"default"in e?e["default"]:e}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=r(void 0!==s?s.videojs:void 0!==n?n.videojs:null),s=r(e(2)),d=r(e(1)),l=t.getComponent("Flash"),a=!t.browser.IS_IPHONE,f=t.registerPlugin||t.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:a,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:"Could not download the video"},"-3":{type:"PLAYER_ERR_DOMAIN_RESTRICTED",headline:"This video is restricted from playing on your current domain"},"-4":{type:"PLAYER_ERR_IP_RESTRICTED",headline:"This video is restricted at your current IP address"},"-5":{type:"PLAYER_ERR_GEO_RESTRICTED",headline:"This video is restricted from playing in your current geographic region"}}},c=function y(e,o){var n=void 0,r=[],i=function(){s.clearTimeout(n),n=s.setTimeout(function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},o.timeout),e.error()&&-2===e.error().code&&e.error(null)},a=function(){for(var o=void 0;r.length;)o=r.shift(),e.off(o[0],o[1]);s.clearTimeout(n)},f=function(o,n){var t=function(){if(!e.error()){var 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 i();if(e.ended())return i()}n.call(this)};e.on(o,t),r.push([o,t])},c=function(){var o=0;a(),i(),f(["timeupdate","adtimeupdate"],function(){var n=e.currentTime();n!==o&&(o=n,i())}),f("progress",i)},p=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},v=function(){var n="",r=e.error(),i=d.createElement("div"),s="";if(r){if(r=t.mergeOptions(r,o.errors[r.code||0]),r.message&&(n='<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&&l&&!l.isSupported()){n+='<span class="vjs-errors-flashmessage">'+e.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>"}var a=e.getChild("errorDisplay");i.className="vjs-errors-dialog",i.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(r.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(r.type||r.code)+"</div>\n "+n+"\n </div>";if(a.closeable(!("dismiss"in r)||r.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",i.innerHTML=s,a.fillWith(i),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());var f=a.el().querySelector(".vjs-errors-ok-button");e.on(f,"click",function(){a.close()})}else i.innerHTML=s,a.fillWith(i);(e.currentWidth()<=600||e.currentHeight()<=250)&&a.addClass("vjs-xs"),a.one("modalclose",function(){return e.error(null)})}},h=function R(){a(),e.removeClass("vjs-errors"),e.off("play",c),e.off("play",p),e.off("dispose",R),e.off("error",v)},E=function(o){h(),y(e,t.mergeOptions(u,o))};E.extend=function(e){o.errors=t.mergeOptions(o.errors,e)},e.on("play",c),e.on("play",p),e.on("dispose",h),e.on("error",v),e.ready(function(){e.addClass("vjs-errors")}),e.errors=E},p=function(e){c(this,t.mergeOptions(u,e))};f("errors",p),o.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,2:2}]},{},[4])(4)}); | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var o;o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,o.videojsErrors=e()}}(function(){return function e(o,n,r){function i(s,d){if(!n[s]){if(!o[s]){var l="function"==typeof require&&require;if(!d&&l)return l(s,!0);if(t)return t(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var f=n[s]={exports:{}};o[s][0].call(f.exports,function(e){var n=o[s][1][e];return i(n||e)},f,f.exports,e,o,n,r)}return n[s].exports}for(var t="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,o,n){(function(n){var r,i=void 0!==n?n:"undefined"!=typeof window?window:{},t=e(3);"undefined"!=typeof document?r=document:(r=i["__GLOBAL_DOCUMENT_CACHE@4"])||(r=i["__GLOBAL_DOCUMENT_CACHE@4"]=t),o.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{3:3}],2:[function(e,o,n){(function(e){var n;n="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},o.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],3:[function(e,o,n){},{}],4:[function(e,o,n){(function(n){"use strict";function r(e){return e&&"object"===(void 0===e?"undefined":i(e))&&"default"in e?e["default"]:e}var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=r(void 0!==s?s.videojs:void 0!==n?n.videojs:null),s=r(e(2)),d=r(e(1)),l=t.getComponent("Flash"),a=!t.browser.IS_IPHONE,f=t.registerPlugin||t.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:a,progressDisabled:!1,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:"Could not download the video"},"-3":{type:"PLAYER_ERR_DOMAIN_RESTRICTED",headline:"This video is restricted from playing on your current domain"},"-4":{type:"PLAYER_ERR_IP_RESTRICTED",headline:"This video is restricted at your current IP address"},"-5":{type:"PLAYER_ERR_GEO_RESTRICTED",headline:"This video is restricted from playing in your current geographic region"}}},c=function y(e,o){var n=void 0,r=[],i=function(){s.clearTimeout(n),n=s.setTimeout(function(){e.error()||e.paused()||e.ended()||e.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},o.timeout),e.error()&&-2===e.error().code&&e.error(null)},a=function(){for(var o=void 0;r.length;)o=r.shift(),e.off(o[0],o[1]);s.clearTimeout(n)},f=function(o,n){var t=function(){if(!e.error()){var 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 i();if(e.ended())return i()}n.call(this)};e.on(o,t),r.push([o,t])},c=function(){var n=0;a(),i(),f(["timeupdate","adtimeupdate"],function(){var o=e.currentTime();o!==n&&(n=o,i())}),o.progressDisabled||f("progress",i)},p=function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},v=function(){var n="",r=e.error(),i=d.createElement("div"),s="";if(r){if(r=t.mergeOptions(r,o.errors[r.code||0]),r.message&&(n='<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&&l&&!l.isSupported()){n+='<span class="vjs-errors-flashmessage">'+e.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>"}var a=e.getChild("errorDisplay");i.className="vjs-errors-dialog",i.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(r.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(r.type||r.code)+"</div>\n "+n+"\n </div>";if(a.closeable(!("dismiss"in r)||r.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",i.innerHTML=s,a.fillWith(i),a.contentEl().firstChild.appendChild(a.getChild("closeButton").el());var f=a.el().querySelector(".vjs-errors-ok-button");e.on(f,"click",function(){a.close()})}else i.innerHTML=s,a.fillWith(i);(e.currentWidth()<=600||e.currentHeight()<=250)&&a.addClass("vjs-xs"),a.one("modalclose",function(){return e.error(null)})}},h=function R(){a(),e.removeClass("vjs-errors"),e.off("play",c),e.off("play",p),e.off("dispose",R),e.off("error",v)},E=function(o){h(),y(e,t.mergeOptions(u,o))};E.extend=function(e){o.errors=t.mergeOptions(o.errors,e)},E.disableProgress=function(e){o.progressDisabled=e,c()},e.on("play",c),e.on("play",p),e.on("dispose",h),e.on("error",v),e.ready(function(){e.addClass("vjs-errors")}),e.errors=E},p=function(e){c(this,t.mergeOptions(u,e))};f("errors",p),o.exports=p}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,2:2}]},{},[4])(4)}); |
@@ -32,2 +32,3 @@ 'use strict'; | ||
dismiss: defaultDismiss, | ||
progressDisabled: false, | ||
errors: { | ||
@@ -174,3 +175,6 @@ '1': { | ||
}); | ||
healthcheck('progress', resetMonitor); | ||
if (!options.progressDisabled) { | ||
healthcheck('progress', resetMonitor); | ||
} | ||
}; | ||
@@ -265,2 +269,7 @@ | ||
reInitPlugin.disableProgress = function (disabled) { | ||
options.progressDisabled = disabled; | ||
onPlayStartMonitor(); | ||
}; | ||
player.on('play', onPlayStartMonitor); | ||
@@ -267,0 +276,0 @@ player.on('play', onPlayNoSource); |
{ | ||
"name": "videojs-errors", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"author": "Brightcove, Inc.", | ||
@@ -5,0 +5,0 @@ "description": "A Video.js plugin for custom error reporting", |
@@ -18,2 +18,3 @@ import videojs from 'video.js'; | ||
dismiss: defaultDismiss, | ||
progressDisabled: false, | ||
errors: { | ||
@@ -164,3 +165,6 @@ '1': { | ||
}); | ||
healthcheck('progress', resetMonitor); | ||
if (!options.progressDisabled) { | ||
healthcheck('progress', resetMonitor); | ||
} | ||
}; | ||
@@ -263,2 +267,7 @@ | ||
reInitPlugin.disableProgress = function(disabled) { | ||
options.progressDisabled = disabled; | ||
onPlayStartMonitor(); | ||
}; | ||
player.on('play', onPlayStartMonitor); | ||
@@ -265,0 +274,0 @@ player.on('play', onPlayNoSource); |
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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
1881
1153380
1
0