videojs-errors
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,13 +0,50 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* | ||
CHANGELOG | ||
========= | ||
- [CHANGELOG](#changelog) | ||
## HEAD (Unreleased) | ||
_(none)_ | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
-------------------- | ||
# CHANGELOG | ||
## v1.0.4 (2016-04-13) | ||
* Added listening for `'adtimeupdate'` ([#36](https://github.com/brightcove/videojs-errors/pull/36)) | ||
* Added Arabic and Turkish ([#38](https://github.com/brightcove/videojs-errors/pull/38)) | ||
- 1.0.0: Update for video.js 5.0 | ||
- 0.1.8: Fixes a bug with dispose() and fixes playback monitor when ended/paused | ||
- 0.1.0: Initial release | ||
## v1.0.3 (2016-03-01) | ||
* Add Italian, Russian and Chinese (traditional and simplified). | ||
* Add English translations as a canonical template. | ||
## v1.0.2 (2016-01-11) | ||
* Bower :) | ||
## v1.0.1 (2016-01-11) | ||
* Updated to use `generator-videojs-plugin` conventions. | ||
## v1.0.0 (2015-11-22) | ||
* Updates for video.js 5.0. | ||
## v0.1.8 (2015-05-05) | ||
* Do not display errors when the player is paused or ended for timeouts. | ||
* Fix a vdata exception when dispose is called. | ||
## v0.1.6 (2014-09-10) | ||
* Remove `dist/` from `.npmignore`. | ||
## v0.1.5 (2014-09-03) | ||
* More localization improvements. | ||
## v0.1.4 (2014-08-27) | ||
* Fix `dist/`. | ||
## v0.1.3 (2014-08-27) | ||
* Localization improvements. | ||
## v0.1.2 (2014-08-19) | ||
* Localization | ||
## v0.1.1 (2014-06-13) | ||
* Ended videos should not cause player timeouts on IE11/Win8rt. | ||
## v0.1.0 (2014-06-05) | ||
* Initial release. | ||
@@ -147,3 +147,3 @@ (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
resetMonitor(); | ||
healthcheck('timeupdate', function () { | ||
healthcheck(['timeupdate', 'adtimeupdate'], function () { | ||
var currentTime = player.currentTime(); | ||
@@ -478,2 +478,20 @@ | ||
_qunit2['default'].test('time changes while playing ads reset the player timeout', function (assert) { | ||
var errors = 0; | ||
this.player.src(sources); | ||
this.player.on('error', function () { | ||
errors++; | ||
}); | ||
this.player.trigger('play'); | ||
this.clock.tick(44 * 1000); | ||
this.player.currentTime = function () { | ||
return 1; | ||
}; | ||
this.player.trigger('adtimeupdate'); | ||
this.clock.tick(10 * 1000); | ||
assert.strictEqual(errors, 0, 'no error emitted'); | ||
}); | ||
_qunit2['default'].test('time changes after a player timeout clears the error', function (assert) { | ||
@@ -480,0 +498,0 @@ this.player.src(sources); |
/** | ||
* videojs-errors | ||
* @version 1.0.3 | ||
* @version 1.0.4 | ||
* @copyright 2016 Brightcove | ||
@@ -132,3 +132,3 @@ * @license Apache-2.0 | ||
resetMonitor(); | ||
healthcheck('timeupdate', function () { | ||
healthcheck(['timeupdate', 'adtimeupdate'], function () { | ||
var currentTime = player.currentTime(); | ||
@@ -135,0 +135,0 @@ |
/** | ||
* videojs-errors | ||
* @version 1.0.3 | ||
* @version 1.0.4 | ||
* @copyright 2016 Brightcove | ||
* @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 t(d,s){if(!n[d]){if(!o[d]){var a="function"==typeof require&&require;if(!s&&a)return a(d,!0);if(i)return i(d,!0);var l=new Error("Cannot find module '"+d+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[d]={exports:{}};o[d][0].call(u.exports,function(e){var n=o[d][1][e];return t(n?n:e)},u,u.exports,e,o,n,r)}return n[d].exports}for(var i="function"==typeof require&&require,d=0;d<r.length;d++)t(r[d]);return t}({1:[function(e,o,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var t="undefined"!=typeof window?window.videojs:"undefined"!=typeof e?e.videojs:null,i=r(t),d={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"}}},s=function(e,o){var n=void 0,r=function(){window.clearTimeout(n),n=window.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)},t=[],i=function(){for(var o=void 0;t.length;)o=t.shift(),e.off(o[0],o[1]);window.clearTimeout(n)},d=function(o,n){var r=function(){return e.paused()?i():e.ended()?i():void n.call(this)};e.on(o,r),t.push([o,r])};e.on("play",function(){var o=0;i(),r(),d("timeupdate",function(){var n=e.currentTime();n!==o&&(o=n,r())}),d("progress",r)}),e.on("dispose",function(){i()})},a=function(e,o){s(e,o),e.on("play",function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})})},l=function(e,o){e.addClass("vjs-errors"),e.on("error",function(){var n=void 0,r="",t=e.error(),d=document.createElement("div");if(t){t=i["default"].mergeOptions(t,o.errors[t.code||0]),t.message&&(r='<div class="vjs-errors-details">'+e.localize("Technical details")+'\n : <div class="vjs-errors-message">'+e.localize(t.message)+"</div>\n </div>"),n=e.errorDisplay,d.className="vjs-errors-dialog",d.innerHTML='<button class="vjs-errors-close-button"></button>\n <div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(t.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(t.type||t.code)+"</div>\n "+r+'\n </div>\n <div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",n.fillWith(d),(e.width()<=600||e.height()<=250)&&n.addClass("vjs-xs");var s=n.el().querySelector(".vjs-errors-close-button"),a=n.el().querySelector(".vjs-errors-ok-button");i["default"].on(s,"click",function(){n.close()}),i["default"].on(a,"click",function(){n.close()})}}),a(e,o)},u=function(e){var o=this;this.ready(function(){l(o,i["default"].mergeOptions(d,e))})};i["default"].plugin("errors",u),n["default"]=u,o.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); | ||
!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 t(d,s){if(!n[d]){if(!o[d]){var a="function"==typeof require&&require;if(!s&&a)return a(d,!0);if(i)return i(d,!0);var l=new Error("Cannot find module '"+d+"'");throw l.code="MODULE_NOT_FOUND",l}var u=n[d]={exports:{}};o[d][0].call(u.exports,function(e){var n=o[d][1][e];return t(n?n:e)},u,u.exports,e,o,n,r)}return n[d].exports}for(var i="function"==typeof require&&require,d=0;d<r.length;d++)t(r[d]);return t}({1:[function(e,o,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(n,"__esModule",{value:!0});var t="undefined"!=typeof window?window.videojs:"undefined"!=typeof e?e.videojs:null,i=r(t),d={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"}}},s=function(e,o){var n=void 0,r=function(){window.clearTimeout(n),n=window.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)},t=[],i=function(){for(var o=void 0;t.length;)o=t.shift(),e.off(o[0],o[1]);window.clearTimeout(n)},d=function(o,n){var r=function(){return e.paused()?i():e.ended()?i():void n.call(this)};e.on(o,r),t.push([o,r])};e.on("play",function(){var o=0;i(),r(),d(["timeupdate","adtimeupdate"],function(){var n=e.currentTime();n!==o&&(o=n,r())}),d("progress",r)}),e.on("dispose",function(){i()})},a=function(e,o){s(e,o),e.on("play",function(){e.currentSrc()||e.error({code:-1,type:"PLAYER_ERR_NO_SRC"})})},l=function(e,o){e.addClass("vjs-errors"),e.on("error",function(){var n=void 0,r="",t=e.error(),d=document.createElement("div");if(t){t=i["default"].mergeOptions(t,o.errors[t.code||0]),t.message&&(r='<div class="vjs-errors-details">'+e.localize("Technical details")+'\n : <div class="vjs-errors-message">'+e.localize(t.message)+"</div>\n </div>"),n=e.errorDisplay,d.className="vjs-errors-dialog",d.innerHTML='<button class="vjs-errors-close-button"></button>\n <div class="vjs-errors-content-container">\n <h2 class="vjs-errors-headline">'+this.localize(t.headline)+"</h2>\n <div><b>"+this.localize("Error Code")+"</b>: "+(t.type||t.code)+"</div>\n "+r+'\n </div>\n <div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",n.fillWith(d),(e.width()<=600||e.height()<=250)&&n.addClass("vjs-xs");var s=n.el().querySelector(".vjs-errors-close-button"),a=n.el().querySelector(".vjs-errors-ok-button");i["default"].on(s,"click",function(){n.close()}),i["default"].on(a,"click",function(){n.close()})}}),a(e,o)},u=function(e){var o=this;this.ready(function(){l(o,i["default"].mergeOptions(d,e))})};i["default"].plugin("errors",u),n["default"]=u,o.exports=n["default"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[1])(1)}); |
@@ -124,3 +124,3 @@ 'use strict'; | ||
resetMonitor(); | ||
healthcheck('timeupdate', function () { | ||
healthcheck(['timeupdate', 'adtimeupdate'], function () { | ||
var currentTime = player.currentTime(); | ||
@@ -127,0 +127,0 @@ |
{ | ||
"name": "videojs-errors", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"author": "Brightcove", | ||
@@ -82,3 +82,3 @@ "description": "A VideoJS plugin for custom error reporting", | ||
"shelljs": "^0.5.3", | ||
"sinon": "^1.0.0", | ||
"sinon": "1.14.1", | ||
"uglify-js": "^2.5.0", | ||
@@ -85,0 +85,0 @@ "videojs-languages": "^1.0.0", |
@@ -116,3 +116,3 @@ import videojs from 'video.js'; | ||
resetMonitor(); | ||
healthcheck('timeupdate', function() { | ||
healthcheck(['timeupdate', 'adtimeupdate'], function() { | ||
let currentTime = player.currentTime(); | ||
@@ -119,0 +119,0 @@ |
@@ -222,2 +222,20 @@ import document from 'global/document'; | ||
QUnit.test('time changes while playing ads reset the player timeout', function(assert) { | ||
let errors = 0; | ||
this.player.src(sources); | ||
this.player.on('error', function() { | ||
errors++; | ||
}); | ||
this.player.trigger('play'); | ||
this.clock.tick(44 * 1000); | ||
this.player.currentTime = function() { | ||
return 1; | ||
}; | ||
this.player.trigger('adtimeupdate'); | ||
this.clock.tick(10 * 1000); | ||
assert.strictEqual(errors, 0, 'no error emitted'); | ||
}); | ||
QUnit.test('time changes after a player timeout clears the error', function(assert) { | ||
@@ -224,0 +242,0 @@ this.player.src(sources); |
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
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
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
85983
36
1631