videojs-errors
Advanced tools
Comparing version 4.0.0 to 4.1.0
@@ -0,1 +1,8 @@ | ||
<a name="4.1.0"></a> | ||
# [4.1.0](https://github.com/brightcove/videojs-errors/compare/v4.0.0...v4.1.0) (2018-05-08) | ||
### Features | ||
* add standard VERSION property ([#120](https://github.com/brightcove/videojs-errors/issues/120)) ([c475d12](https://github.com/brightcove/videojs-errors/commit/c475d12)) | ||
<a name="4.0.0"></a> | ||
@@ -2,0 +9,0 @@ # [4.0.0](https://github.com/brightcove/videojs-errors/compare/v3.1.0...v4.0.0) (2018-05-02) |
@@ -8,2 +8,4 @@ 'use strict'; | ||
var version = "4.1.0"; | ||
var FlashObj = videojs.getComponent('Flash'); | ||
@@ -325,2 +327,5 @@ var defaultDismiss = !videojs.browser.IS_IPHONE; | ||
// Include the version number. | ||
reInitPlugin.VERSION = version; | ||
player.errors = reInitPlugin; | ||
@@ -339,2 +344,5 @@ }; | ||
// Include the version number. | ||
errors.VERSION = version; | ||
// Register the plugin with video.js. | ||
@@ -341,0 +349,0 @@ registerPlugin('errors', errors); |
import videojs from 'video.js'; | ||
import document from 'global/document'; | ||
var version = "4.1.0"; | ||
var FlashObj = videojs.getComponent('Flash'); | ||
@@ -320,2 +322,5 @@ var defaultDismiss = !videojs.browser.IS_IPHONE; | ||
// Include the version number. | ||
reInitPlugin.VERSION = version; | ||
player.errors = reInitPlugin; | ||
@@ -334,2 +339,5 @@ }; | ||
// Include the version number. | ||
errors.VERSION = version; | ||
// Register the plugin with video.js. | ||
@@ -336,0 +344,0 @@ registerPlugin('errors', errors); |
/** | ||
* videojs-errors | ||
* @version 4.0.0 | ||
* @version 4.1.0 | ||
* @copyright 2018 Brightcove, Inc. | ||
@@ -44,2 +44,4 @@ * @license Apache-2.0 | ||
var version = "4.1.0"; | ||
var FlashObj = videojs.getComponent('Flash'); | ||
@@ -361,2 +363,5 @@ var defaultDismiss = !videojs.browser.IS_IPHONE; | ||
// Include the version number. | ||
reInitPlugin.VERSION = version; | ||
player.errors = reInitPlugin; | ||
@@ -375,2 +380,5 @@ }; | ||
// Include the version number. | ||
errors.VERSION = version; | ||
// Register the plugin with video.js. | ||
@@ -377,0 +385,0 @@ registerPlugin('errors', errors); |
/** | ||
* videojs-errors | ||
* @version 4.0.0 | ||
* @version 4.1.0 | ||
* @copyright 2018 Brightcove, Inc. | ||
* @license Apache-2.0 | ||
*/ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],r):e.videojsErrors=r(e.videojs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;var r,o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},n=(Object.freeze||Object)({"default":i}),t=n&&i||n,s=void 0!==o?o:"undefined"!=typeof window?window:{};"undefined"!=typeof document?r=document:(r=s["__GLOBAL_DOCUMENT_CACHE@4"])||(r=s["__GLOBAL_DOCUMENT_CACHE@4"]=t);var d=r,a=e.getComponent("Flash"),l=!e.browser.IS_IPHONE,c=e.registerPlugin||e.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:l,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"},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."}}},f=function(r){!function o(r,i){var n=void 0,t=void 0,s=void 0,l=[],c=function(r){i.errors=e.mergeOptions(i.errors,r),Object.keys(i.errors).forEach(function(e){var r=i.errors[e];r.type||(r.type=e)})};c();var f=function(){r.clearTimeout(t),s&&(s=!1,r.removeClass("vjs-waiting")),t=r.setTimeout(function(){r.error()||r.paused()||r.ended()||(s=!0,r.addClass("vjs-waiting"))},1e3),r.clearTimeout(n),n=r.setTimeout(function(){r.error()||r.paused()||r.ended()||r.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},i.timeout),r.error()&&-2===r.error().code&&r.error(null)},p=function(){for(var e=void 0;l.length;)e=l.shift(),r.off(e[0],e[1]);r.clearTimeout(n),r.clearTimeout(t)},v=function(e,o){var i=function(){if(!r.error()){var e=r.$(".vjs-tech");if(e&&"application/x-shockwave-flash"===e.type&&!e.vjs_getProperty)return void r.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(r.paused())return f();if(r.ended())return f()}o.call(this)};r.on(e,i),l.push([e,i])},h=function(){var e=0;p(),f(),v(["timeupdate","adtimeupdate"],function(){var o=r.currentTime();o!==e&&(e=o,f())}),i.progressDisabled||v("progress",f)},E=function(){r.currentSrc()||r.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},R=function(){var o="",n=r.error(),t=d.createElement("div"),s="";if(n){(n=e.mergeOptions(n,i.errors[n.code||n.type||0])).message&&(o='<div class="vjs-errors-details">'+r.localize("Technical details")+'\n : <div class="vjs-errors-message">'+r.localize(n.message)+"</div>\n </div>"),4===n.code&&a&&!a.isSupported()&&(o+='<span class="vjs-errors-flashmessage">'+r.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>");var l=r.getChild("errorDisplay");if(t.className="vjs-errors-dialog",t.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(n.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(n.type||n.code)+"</div>\n "+o+"\n </div>",l.closeable(!("dismiss"in n)||n.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",t.innerHTML=s,l.fillWith(t),l.contentEl().firstChild.appendChild(l.getChild("closeButton").el());var c=l.el().querySelector(".vjs-errors-ok-button");r.on(c,"click",function(){l.close()})}else t.innerHTML=s,l.fillWith(t);(r.currentWidth()<=600||r.currentHeight()<=250)&&l.addClass("vjs-xs"),l.one("modalclose",function(){return r.error(null)})}},y=function m(){p(),r.removeClass("vjs-errors"),r.off("play",h),r.off("play",E),r.off("dispose",m),r.off(["aderror","error"],R)},_=function(i){y(),o(r,e.mergeOptions(u,i))};_.extend=function(e){return c(e)},_.getAll=function(){return e.mergeOptions(i.errors)},_.timeout=function(e){if(void 0===e)return i.timeout;e!==i.timeout&&(i.timeout=e,r.paused()||h())},_.disableProgress=function(e){i.progressDisabled=e,h()},r.on("play",h),r.on("play",E),r.on("dispose",y),r.on(["aderror","error"],R),r.ready(function(){r.addClass("vjs-errors")}),r.paused()||h(),r.errors=_}(this,e.mergeOptions(u,r))};return["extend","getAll","disableProgress"].forEach(function(r){f[r]=function(){e.log.warn("The errors."+r+"() method is not available until the plugin has been initialized!")}}),c("errors",f),f}); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],r):e.videojsErrors=r(e.videojs)}(this,function(e){"use strict";e=e&&e.hasOwnProperty("default")?e["default"]:e;var r,o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},i={},n=(Object.freeze||Object)({"default":i}),t=n&&i||n,s=void 0!==o?o:"undefined"!=typeof window?window:{};"undefined"!=typeof document?r=document:(r=s["__GLOBAL_DOCUMENT_CACHE@4"])||(r=s["__GLOBAL_DOCUMENT_CACHE@4"]=t);var d=r,a=e.getComponent("Flash"),l=!e.browser.IS_IPHONE,c=e.registerPlugin||e.plugin,u={header:"",code:"",message:"",timeout:45e3,dismiss:l,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"},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."}}},f=function(r){!function o(r,i){var n=void 0,t=void 0,s=void 0,l=[],c=function(r){i.errors=e.mergeOptions(i.errors,r),Object.keys(i.errors).forEach(function(e){var r=i.errors[e];r.type||(r.type=e)})};c();var f=function(){r.clearTimeout(t),s&&(s=!1,r.removeClass("vjs-waiting")),t=r.setTimeout(function(){r.error()||r.paused()||r.ended()||(s=!0,r.addClass("vjs-waiting"))},1e3),r.clearTimeout(n),n=r.setTimeout(function(){r.error()||r.paused()||r.ended()||r.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},i.timeout),r.error()&&-2===r.error().code&&r.error(null)},p=function(){for(var e=void 0;l.length;)e=l.shift(),r.off(e[0],e[1]);r.clearTimeout(n),r.clearTimeout(t)},v=function(e,o){var i=function(){if(!r.error()){var e=r.$(".vjs-tech");if(e&&"application/x-shockwave-flash"===e.type&&!e.vjs_getProperty)return void r.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(r.paused())return f();if(r.ended())return f()}o.call(this)};r.on(e,i),l.push([e,i])},h=function(){var e=0;p(),f(),v(["timeupdate","adtimeupdate"],function(){var o=r.currentTime();o!==e&&(e=o,f())}),i.progressDisabled||v("progress",f)},E=function(){r.currentSrc()||r.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},R=function(){var o="",n=r.error(),t=d.createElement("div"),s="";if(n){(n=e.mergeOptions(n,i.errors[n.code||n.type||0])).message&&(o='<div class="vjs-errors-details">'+r.localize("Technical details")+'\n : <div class="vjs-errors-message">'+r.localize(n.message)+"</div>\n </div>"),4===n.code&&a&&!a.isSupported()&&(o+='<span class="vjs-errors-flashmessage">'+r.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>");var l=r.getChild("errorDisplay");if(t.className="vjs-errors-dialog",t.id="vjs-errors-dialog",s='<div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(n.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(n.type||n.code)+"</div>\n "+o+"\n </div>",l.closeable(!("dismiss"in n)||n.dismiss)){s+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",t.innerHTML=s,l.fillWith(t),l.contentEl().firstChild.appendChild(l.getChild("closeButton").el());var c=l.el().querySelector(".vjs-errors-ok-button");r.on(c,"click",function(){l.close()})}else t.innerHTML=s,l.fillWith(t);(r.currentWidth()<=600||r.currentHeight()<=250)&&l.addClass("vjs-xs"),l.one("modalclose",function(){return r.error(null)})}},y=function m(){p(),r.removeClass("vjs-errors"),r.off("play",h),r.off("play",E),r.off("dispose",m),r.off(["aderror","error"],R)},_=function(i){y(),o(r,e.mergeOptions(u,i))};_.extend=function(e){return c(e)},_.getAll=function(){return e.mergeOptions(i.errors)},_.timeout=function(e){if(void 0===e)return i.timeout;e!==i.timeout&&(i.timeout=e,r.paused()||h())},_.disableProgress=function(e){i.progressDisabled=e,h()},r.on("play",h),r.on("play",E),r.on("dispose",y),r.on(["aderror","error"],R),r.ready(function(){r.addClass("vjs-errors")}),r.paused()||h(),_.VERSION="4.1.0",r.errors=_}(this,e.mergeOptions(u,r))};return["extend","getAll","disableProgress"].forEach(function(r){f[r]=function(){e.log.warn("The errors."+r+"() method is not available until the plugin has been initialized!")}}),f.VERSION="4.1.0",c("errors",f),f}); |
{ | ||
"name": "videojs-errors", | ||
"version": "4.0.0", | ||
"version": "4.1.0", | ||
"author": "Brightcove, Inc.", | ||
@@ -5,0 +5,0 @@ "description": "A Video.js plugin for custom error reporting", |
@@ -31,2 +31,3 @@ /** | ||
plugins: [ | ||
json(), | ||
multiEntry({ | ||
@@ -33,0 +34,0 @@ exports: false |
import videojs from 'video.js'; | ||
import document from 'global/document'; | ||
import {version as VERSION} from '../package.json'; | ||
@@ -330,2 +331,5 @@ const FlashObj = videojs.getComponent('Flash'); | ||
// Include the version number. | ||
reInitPlugin.VERSION = VERSION; | ||
player.errors = reInitPlugin; | ||
@@ -346,2 +350,5 @@ }; | ||
// Include the version number. | ||
errors.VERSION = VERSION; | ||
// Register the plugin with video.js. | ||
@@ -348,0 +355,0 @@ registerPlugin('errors', errors); |
@@ -37,2 +37,4 @@ (function (QUnit,sinon,videojs) { | ||
var version = "4.1.0"; | ||
var FlashObj = videojs.getComponent('Flash'); | ||
@@ -354,2 +356,5 @@ var defaultDismiss = !videojs.browser.IS_IPHONE; | ||
// Include the version number. | ||
reInitPlugin.VERSION = version; | ||
player.errors = reInitPlugin; | ||
@@ -368,2 +373,5 @@ }; | ||
// Include the version number. | ||
errors.VERSION = version; | ||
// Register the plugin with video.js. | ||
@@ -370,0 +378,0 @@ registerPlugin('errors', errors); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
1165618
3506
1