videojs-errors
Advanced tools
Comparing version 0.1.7 to 0.1.8
@@ -1,3 +0,3 @@ | ||
/*! videojs-errors - v0.1.6 - 2014-09-23 | ||
* Copyright (c) 2014 Brightcove; Licensed Apache-2.0 */ | ||
/*! videojs-errors - v0.1.8 - 2015-05-05 | ||
* Copyright (c) 2015 Brightcove; Licensed Apache-2.0 */ | ||
(function(){ | ||
@@ -59,4 +59,5 @@ var | ||
monitor = window.setTimeout(function() { | ||
if (player.error()) { | ||
// never overwrite existing errors | ||
if (player.error() || player.paused() || player.ended()) { | ||
// never overwrite existing errors or display a new one | ||
// if the player is paused or ended. | ||
return; | ||
@@ -121,2 +122,6 @@ } | ||
}); | ||
player.on('dispose', function() { | ||
cleanup(); | ||
}); | ||
}, | ||
@@ -123,0 +128,0 @@ // shim in IE8 event listener support |
@@ -1,3 +0,3 @@ | ||
/*! videojs-errors - v0.1.6 - 2014-09-23 | ||
* Copyright (c) 2014 Brightcove; Licensed Apache-2.0 */ | ||
!function(){var a={header:"",code:"",message:"",timeout:45e3,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"}}},b=function(b,c){var d,e=videojs.util.mergeOptions(a,c),f=function(){window.clearTimeout(d),d=window.setTimeout(function(){b.error()||b.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},e.timeout),b.error()&&-2===b.error().code&&b.error(null)},g=[],h=function(a,c){var d=function(){return b.paused()?i():b.ended()?i():void c.call(this)};b.on(a,d),g.push([a,d])},i=function(){for(var a;g.length;)a=g.shift(),b.off(a[0],a[1]);window.clearTimeout(d)};b.on("play",function(){var a=0;i(),f(),h("timeupdate",function(){var c=b.currentTime();c!==a&&(a=c,f())}),h("progress",f)})},c=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)},d=function(a,c){b(a,c),a.on("play",function(){(null===a.currentSrc()||void 0===a.currentSrc()||""===a.currentSrc())&&a.error({code:-1,type:"PLAYER_ERR_NO_SRC"})})};videojs.plugin("errors",function(b){var e=this,f=videojs.util.mergeOptions(a,b);this.on("error",function(){var a,b,d="";a=videojs.util.mergeOptions(this.error(),f.errors[this.error().code||0]),a.message&&(d='<div class="vjs-errors-details">'+this.localize("Technical details")+': <div class="vjs-errors-message">'+this.localize(a.message)+"</div></div>"),b=this.errorDisplay,b.el().innerHTML='<div class="vjs-errors-dialog"><button class="vjs-errors-close-button"></button><div class="vjs-errors-content-container"><h2 class="vjs-errors-headline">'+this.localize(a.headline)+"</h2><div><b>"+this.localize("Error Code")+"</b>: "+(a.type||a.code)+"</div>"+this.localize(d)+'</div><div class="vjs-errors-ok-button-container"><button class="vjs-errors-ok-button">'+this.localize("OK")+"</button></div></div>",(e.width()<=600||e.height()<=250)&&b.addClass("vjs-xs"),c(b.el().querySelector(".vjs-errors-close-button"),"click",function(){b.hide()}),c(b.el().querySelector(".vjs-errors-ok-button"),"click",function(){b.hide()})}),d(this,f)})}(); | ||
/*! videojs-errors - v0.1.8 - 2015-05-05 | ||
* Copyright (c) 2015 Brightcove; Licensed Apache-2.0 */ | ||
!function(){var a={header:"",code:"",message:"",timeout:45e3,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"}}},b=function(b,c){var d,e=videojs.util.mergeOptions(a,c),f=function(){window.clearTimeout(d),d=window.setTimeout(function(){b.error()||b.paused()||b.ended()||b.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},e.timeout),b.error()&&-2===b.error().code&&b.error(null)},g=[],h=function(a,c){var d=function(){return b.paused()?i():b.ended()?i():void c.call(this)};b.on(a,d),g.push([a,d])},i=function(){for(var a;g.length;)a=g.shift(),b.off(a[0],a[1]);window.clearTimeout(d)};b.on("play",function(){var a=0;i(),f(),h("timeupdate",function(){var c=b.currentTime();c!==a&&(a=c,f())}),h("progress",f)}),b.on("dispose",function(){i()})},c=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent("on"+b,c)},d=function(a,c){b(a,c),a.on("play",function(){(null===a.currentSrc()||void 0===a.currentSrc()||""===a.currentSrc())&&a.error({code:-1,type:"PLAYER_ERR_NO_SRC"})})};videojs.plugin("errors",function(b){var e=this,f=videojs.util.mergeOptions(a,b);this.on("error",function(){var a,b,d="";a=videojs.util.mergeOptions(this.error(),f.errors[this.error().code||0]),a.message&&(d='<div class="vjs-errors-details">'+this.localize("Technical details")+': <div class="vjs-errors-message">'+this.localize(a.message)+"</div></div>"),b=this.errorDisplay,b.el().innerHTML='<div class="vjs-errors-dialog"><button class="vjs-errors-close-button"></button><div class="vjs-errors-content-container"><h2 class="vjs-errors-headline">'+this.localize(a.headline)+"</h2><div><b>"+this.localize("Error Code")+"</b>: "+(a.type||a.code)+"</div>"+this.localize(d)+'</div><div class="vjs-errors-ok-button-container"><button class="vjs-errors-ok-button">'+this.localize("OK")+"</button></div></div>",(e.width()<=600||e.height()<=250)&&b.addClass("vjs-xs"),c(b.el().querySelector(".vjs-errors-close-button"),"click",function(){b.hide()}),c(b.el().querySelector(".vjs-errors-ok-button"),"click",function(){b.hide()})}),d(this,f)})}(); |
{ | ||
"name": "videojs-errors", | ||
"version": "0.1.7", | ||
"version": "0.1.8", | ||
"author": "Brightcove", | ||
@@ -34,5 +34,5 @@ "description": "A VideoJS plugin for custom error reporting", | ||
"qunitjs": "^1.12", | ||
"sinon": "^1.9.1", | ||
"video.js": "^4.7.3" | ||
"sinon": "^1.14.1", | ||
"video.js": "^4.12.5" | ||
} | ||
} |
@@ -75,2 +75,3 @@ Video.js Error Messages | ||
## Release History | ||
- 0.1.0: Initial release | ||
- 0.1.8: Fixes a bug with dispose() and fixes playback monitor when ended/paused | ||
- 0.1.0: Initial release |
@@ -57,4 +57,5 @@ (function(){ | ||
monitor = window.setTimeout(function() { | ||
if (player.error()) { | ||
// never overwrite existing errors | ||
if (player.error() || player.paused() || player.ended()) { | ||
// never overwrite existing errors or display a new one | ||
// if the player is paused or ended. | ||
return; | ||
@@ -119,2 +120,6 @@ } | ||
}); | ||
player.on('dispose', function() { | ||
cleanup(); | ||
}); | ||
}, | ||
@@ -121,0 +126,0 @@ // shim in IE8 event listener support |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36157
697
77
23
1