Socket
Socket
Sign inDemoInstall

videojs-errors

Package Overview
Dependencies
Maintainers
59
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

videojs-errors - npm Package Compare versions

Comparing version 4.1.2 to 4.1.3

7

CHANGELOG.md

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

<a name="4.1.3"></a>
## [4.1.3](https://github.com/brightcove/videojs-errors/compare/v4.1.2...v4.1.3) (2018-08-23)
### Chores
* generator v7 ([#133](https://github.com/brightcove/videojs-errors/issues/133)) ([365e7b8](https://github.com/brightcove/videojs-errors/commit/365e7b8))
<a name="4.1.2"></a>

@@ -2,0 +9,0 @@ ## [4.1.2](https://github.com/brightcove/videojs-errors/compare/v4.1.1...v4.1.2) (2018-08-03)

2

CONTRIBUTING.md

@@ -7,3 +7,3 @@ # CONTRIBUTING

Make sure you have NodeJS 0.10 or higher and npm installed.
Make sure you have Node.js 4.8 or higher and npm installed.

@@ -10,0 +10,0 @@ 1. Fork this repository and clone your fork

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

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

@@ -9,3 +9,3 @@

var version = "4.1.2";
var version = "4.1.3";

@@ -12,0 +12,0 @@ var FlashObj = videojs.getComponent('Flash');

@@ -1,6 +0,6 @@

/*! @name videojs-errors @version 4.1.2 @license Apache-2.0 */
/*! @name videojs-errors @version 4.1.3 @license Apache-2.0 */
import videojs from 'video.js';
import document from 'global/document';
var version = "4.1.2";
var version = "4.1.3";

@@ -7,0 +7,0 @@ var FlashObj = videojs.getComponent('Flash');

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

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

@@ -11,3 +11,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('video.js'), require('global/document')) :

var version = "4.1.2";
var version = "4.1.3";

@@ -14,0 +14,0 @@ var FlashObj = videojs.getComponent('Flash');

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

/*! @name videojs-errors @version 4.1.2 @license Apache-2.0 */
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("video.js"),require("global/document")):"function"==typeof define&&define.amd?define(["video.js","global/document"],r):e.videojsErrors=r(e.videojs,e.document)}(this,function(e,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,r=r&&r.hasOwnProperty("default")?r.default:r;var o=e.getComponent("Flash"),i=!e.browser.IS_IPHONE,n=e.registerPlugin||e.plugin,t={header:"",code:"",message:"",timeout:45e3,dismiss:i,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."}}},s=function(i){!function i(n,s){var a=void 0,d=void 0,l=void 0,c=[],u=function(r){s.errors=e.mergeOptions(s.errors,r),Object.keys(s.errors).forEach(function(e){var r=s.errors[e];r.type||(r.type=e)})};u();var p=function(){n.clearTimeout(d),l&&(l=!1,n.removeClass("vjs-waiting")),d=n.setTimeout(function(){n.error()||n.paused()||n.ended()||(l=!0,n.addClass("vjs-waiting"))},1e3),n.clearTimeout(a),a=n.setTimeout(function(){n.error()||n.paused()||n.ended()||n.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},s.timeout),n.error()&&-2===n.error().code&&n.error(null)},f=function(){for(var e=void 0;c.length;)e=c.shift(),n.off(e[0],e[1]);n.clearTimeout(a),n.clearTimeout(d)},h=function(e,r){var o=function(){if(!n.error()){var e=n.$(".vjs-tech");if(e&&"application/x-shockwave-flash"===e.type&&!e.vjs_getProperty)return void n.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(n.paused())return p();if(n.ended())return p()}r.call(this)};n.on(e,o),c.push([e,o])},v=function(){var e=0;f(),p(),h(["timeupdate","adtimeupdate"],function(){var r=n.currentTime();r!==e&&(e=r,p())}),s.progressDisabled||h("progress",p)},E=function(){n.currentSrc()||n.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},R=function(){var i="",t=n.error(),a=r.createElement("div"),d="";if(t){(t=e.mergeOptions(t,s.errors[t.code||t.type||0])).message&&(i='<div class="vjs-errors-details">'+n.localize("Technical details")+'\n : <div class="vjs-errors-message">'+n.localize(t.message)+"</div>\n </div>"),4===t.code&&o&&!o.isSupported()&&(i+='<span class="vjs-errors-flashmessage">'+n.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>");var l=n.getChild("errorDisplay");if(a.className="vjs-errors-dialog",a.id="vjs-errors-dialog",d='<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 "+i+"\n </div>",l.closeable(!("dismiss"in t)||t.dismiss)){d+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",a.innerHTML=d,l.fillWith(a),l.contentEl().firstChild.appendChild(l.getChild("closeButton").el());var c=l.el().querySelector(".vjs-errors-ok-button");n.on(c,"click",function(){l.close()})}else a.innerHTML=d,l.fillWith(a);(n.currentWidth()<=600||n.currentHeight()<=250)&&l.addClass("vjs-xs"),l.one("modalclose",function(){return n.error(null)})}},m=function e(){f(),n.removeClass("vjs-errors"),n.off("play",v),n.off("play",E),n.off("dispose",e),n.off(["aderror","error"],R)},g=function(r){m(),i(n,e.mergeOptions(t,r))};g.extend=function(e){return u(e)},g.getAll=function(){return e.mergeOptions(s.errors)},g.timeout=function(e){if(void 0===e)return s.timeout;e!==s.timeout&&(s.timeout=e,n.paused()||v())},g.disableProgress=function(e){s.progressDisabled=e,v()},n.on("play",v),n.on("play",E),n.on("dispose",m),n.on(["aderror","error"],R),n.ready(function(){n.addClass("vjs-errors")}),n.paused()||v(),g.VERSION="4.1.2",n.errors=g}(this,e.mergeOptions(t,i))};return["extend","getAll","disableProgress"].forEach(function(r){s[r]=function(){e.log.warn("The errors."+r+"() method is not available until the plugin has been initialized!")}}),s.VERSION="4.1.2",n("errors",s),s});
/*! @name videojs-errors @version 4.1.3 @license Apache-2.0 */
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r(require("video.js"),require("global/document")):"function"==typeof define&&define.amd?define(["video.js","global/document"],r):e.videojsErrors=r(e.videojs,e.document)}(this,function(e,r){"use strict";e=e&&e.hasOwnProperty("default")?e.default:e,r=r&&r.hasOwnProperty("default")?r.default:r;var o=e.getComponent("Flash"),i=!e.browser.IS_IPHONE,n=e.registerPlugin||e.plugin,t={header:"",code:"",message:"",timeout:45e3,dismiss:i,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."}}},s=function(i){!function i(n,s){var a=void 0,d=void 0,l=void 0,c=[],u=function(r){s.errors=e.mergeOptions(s.errors,r),Object.keys(s.errors).forEach(function(e){var r=s.errors[e];r.type||(r.type=e)})};u();var p=function(){n.clearTimeout(d),l&&(l=!1,n.removeClass("vjs-waiting")),d=n.setTimeout(function(){n.error()||n.paused()||n.ended()||(l=!0,n.addClass("vjs-waiting"))},1e3),n.clearTimeout(a),a=n.setTimeout(function(){n.error()||n.paused()||n.ended()||n.error({code:-2,type:"PLAYER_ERR_TIMEOUT"})},s.timeout),n.error()&&-2===n.error().code&&n.error(null)},f=function(){for(var e=void 0;c.length;)e=c.shift(),n.off(e[0],e[1]);n.clearTimeout(a),n.clearTimeout(d)},h=function(e,r){var o=function(){if(!n.error()){var e=n.$(".vjs-tech");if(e&&"application/x-shockwave-flash"===e.type&&!e.vjs_getProperty)return void n.error({code:-2,type:"PLAYER_ERR_TIMEOUT"});if(n.paused())return p();if(n.ended())return p()}r.call(this)};n.on(e,o),c.push([e,o])},v=function(){var e=0;f(),p(),h(["timeupdate","adtimeupdate"],function(){var r=n.currentTime();r!==e&&(e=r,p())}),s.progressDisabled||h("progress",p)},E=function(){n.currentSrc()||n.error({code:-1,type:"PLAYER_ERR_NO_SRC"})},R=function(){var i="",t=n.error(),a=r.createElement("div"),d="";if(t){(t=e.mergeOptions(t,s.errors[t.code||t.type||0])).message&&(i='<div class="vjs-errors-details">'+n.localize("Technical details")+'\n : <div class="vjs-errors-message">'+n.localize(t.message)+"</div>\n </div>"),4===t.code&&o&&!o.isSupported()&&(i+='<span class="vjs-errors-flashmessage">'+n.localize("If you are using an older browser please try upgrading or installing Flash.")+"</span>");var l=n.getChild("errorDisplay");if(a.className="vjs-errors-dialog",a.id="vjs-errors-dialog",d='<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 "+i+"\n </div>",l.closeable(!("dismiss"in t)||t.dismiss)){d+='<div class="vjs-errors-ok-button-container">\n <button class="vjs-errors-ok-button">'+this.localize("OK")+"</button>\n </div>",a.innerHTML=d,l.fillWith(a),l.contentEl().firstChild.appendChild(l.getChild("closeButton").el());var c=l.el().querySelector(".vjs-errors-ok-button");n.on(c,"click",function(){l.close()})}else a.innerHTML=d,l.fillWith(a);(n.currentWidth()<=600||n.currentHeight()<=250)&&l.addClass("vjs-xs"),l.one("modalclose",function(){return n.error(null)})}},m=function e(){f(),n.removeClass("vjs-errors"),n.off("play",v),n.off("play",E),n.off("dispose",e),n.off(["aderror","error"],R)},g=function(r){m(),i(n,e.mergeOptions(t,r))};g.extend=function(e){return u(e)},g.getAll=function(){return e.mergeOptions(s.errors)},g.timeout=function(e){if(void 0===e)return s.timeout;e!==s.timeout&&(s.timeout=e,n.paused()||v())},g.disableProgress=function(e){s.progressDisabled=e,v()},n.on("play",v),n.on("play",E),n.on("dispose",m),n.on(["aderror","error"],R),n.ready(function(){n.addClass("vjs-errors")}),n.paused()||v(),g.VERSION="4.1.3",n.errors=g}(this,e.mergeOptions(t,i))};return["extend","getAll","disableProgress"].forEach(function(r){s[r]=function(){e.log.warn("The errors."+r+"() method is not available until the plugin has been initialized!")}}),s.VERSION="4.1.3",n("errors",s),s});
{
"name": "videojs-errors",
"version": "4.1.2",
"version": "4.1.3",
"author": "Brightcove, Inc.",

@@ -18,3 +18,3 @@ "description": "A Video.js plugin for custom error reporting",

"generator-videojs-plugin": {
"version": "6.1.4"
"version": "7.0.2"
},

@@ -25,9 +25,8 @@ "scripts": {

"build:css": "node-sass src/plugin.scss dist/videojs-errors.css --output-style=compressed --linefeed=lf",
"build:css:postcss": "postcss --verbose -o dist/videojs-errors.css --config scripts/postcss.config.js src/plugin.css",
"build:js": "rollup -c scripts/rollup.config.js",
"build:lang": "vjslang --dir dist/lang",
"clean": "rimraf dist test/dist",
"postclean": "mkdirp dist test/dist",
"clean": "shx rm -rf ./dist ./test/dist",
"postclean": "shx mkdir -p ./dist ./test/dist",
"docs": "npm-run-all docs:*",
"docs:api": "jsdoc src -r -c scripts/jsdoc.json -d docs/api",
"docs:api": "jsdoc src -g plugins/markdown -r -c scripts/jsdoc.json -d docs/api",
"docs:toc": "doctoc README.md",

@@ -39,4 +38,5 @@ "lint": "vjsstandard",

"test": "karma start scripts/karma.conf.js",
"update-changelog": "conventional-changelog -p videojs -i CHANGELOG.md -s",
"preversion": "npm test",
"version": "node scripts/version.js",
"version": "is-prerelease || npm run update-changelog && git add CHANGELOG.md",
"watch": "npm-run-all -p watch:*",

@@ -46,4 +46,3 @@ "watch:css": "npm run build:css -- -w",

"prepublish": "not-in-install && npm run build || in-install",
"prepush": "npm run lint",
"precommit": "npm run docs:toc && git add README.md"
"precommit": "lint-staged"
},

@@ -71,46 +70,22 @@ "vjsstandard": {

"devDependencies": {
"autoprefixer": "^9.0.0",
"babel-core": "^6.26.3",
"babel-plugin-external-helpers": "^6.22.0",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-preset-env": "^1.7.0",
"conventional-changelog-cli": "^2.0.0",
"conventional-changelog-cli": "^2.0.1",
"conventional-changelog-videojs": "^3.0.0",
"cssnano": "^4.0.3",
"doctoc": "^1.3.1",
"husky": "^0.14.3",
"in-publish": "^2.0.0",
"jsdoc": "^3.4.3",
"karma": "^2.0.2",
"karma-browserstack-launcher": "^1.3.0",
"karma-chrome-launcher": "^2.2.0",
"karma-detect-browsers": "^2.2.6",
"karma-firefox-launcher": "^1.1.0",
"karma-ie-launcher": "^1.0.0",
"karma-qunit": "^2.0.0",
"karma-safari-launcher": "^1.0.0",
"karma-safaritechpreview-launcher": "0.0.6",
"karma-teamcity-reporter": "^1.1.0",
"mkdirp": "^0.5.1",
"jsdoc": "https://github.com/BrandonOCasey/jsdoc#feat/plugin-from-cli",
"karma": "^3.0.0",
"lint-staged": "^7.2.2",
"node-sass": "^4.5.3",
"npm-run-all": "^4.1.2",
"postcss-banner": "^3.0.0",
"not-prerelease": "^1.0.1",
"npm-run-all": "^4.1.3",
"postcss-cli": "^6.0.0",
"postcss-import": "^11.1.0",
"postcss-preset-env": "^5.1.0",
"qunit": "^2.5.1",
"rimraf": "^2.6.1",
"rollup": "^0.63.2",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-json": "^3.0.0",
"rollup-plugin-multi-entry": "^2.0.2",
"rollup-plugin-node-resolve": "^3.0.0",
"rollup-plugin-uglify": "^4.0.0",
"semver": "^5.1.0",
"serve-static": "^1.13.2",
"sinon": "^5.1.0",
"uglify-es": "^3.3.9",
"rollup": "^0.64.1",
"shx": "^0.3.2",
"sinon": "^6.1.5",
"videojs-generate-karma-config": "~1.0.1",
"videojs-generate-postcss-config": "~2.0.1",
"videojs-generate-rollup-config": "~1.0.0",
"videojs-languages": "^1.0.0",
"videojs-standard": "^6.0.3"
"videojs-standard": "^7.0.1"
},

@@ -120,3 +95,13 @@ "browserslist": [

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

@@ -1,166 +0,6 @@

/* eslint-disable no-console, camelcase */
const serveStatic = require('serve-static');
const pkg = require('../package.json');
const generate = require('videojs-generate-karma-config');
/* allow static files to be served, note karma will takeover the /test directory */
const StaticMiddlewareFactory = function(config) {
console.log(`**** static file server started for ${config.basePath} *****`);
const serve = serveStatic(
config.basePath,
{index: ['index.html', 'index.htm']}
);
return function(req, res, next) {
res.setHeader('Cache-Control', 'no-cache,must-revalidate');
return serve(req, res, next);
};
};
/* browsers to run on teamcity */
const teamcityLaunchers = {};
/* browsers to run on browserstack */
const browserstackLaunchers = {
bsChrome: {
base: 'BrowserStack',
browser: 'chrome',
os: 'Windows',
os_version: '10'
},
bsFirefox: {
base: 'BrowserStack',
browser: 'firefox',
os: 'Windows',
os_version: '10'
},
bsSafariSierra: {
base: 'BrowserStack',
browser: 'safari',
os: 'OS X',
os_version: 'Sierra'
},
bsEdgeWin10: {
base: 'BrowserStack',
browser: 'edge',
os: 'Windows',
os_version: '10'
},
bsIE11Win10: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '10'
},
bsIE11Win7: {
base: 'BrowserStack',
browser: 'ie',
browser_version: '11',
os: 'Windows',
os_version: '7'
}
};
/* browsers to run on travis */
const travisLaunchers = {
travisFirefox: {
base: 'Firefox'
},
travisChrome: {
base: 'Chrome',
flags: ['--no-sandbox']
}
};
module.exports = function(config) {
/* Default configuration */
config.set({
basePath: '..',
frameworks: ['qunit', 'detectBrowsers'],
customLaunchers: Object.assign(
{},
travisLaunchers,
teamcityLaunchers,
browserstackLaunchers
),
client: {clearContext: false, qunit: {showUI: true, testTimeout: 5000}},
detectBrowsers: {
enabled: false,
usePhantomJS: false
},
browserStack: {
project: process.env.TEAMCITY_PROJECT_NAME || pkg.name,
name: '',
build: process.env.TRAVIS_BUILD_NUMBER || process.env.BUILD_NUMBER,
pollingTimeout: 30000,
captureTimeout: 600,
timeout: 600
},
reporters: ['dots'],
files: [
'node_modules/video.js/dist/video-js.css',
'dist/videojs-errors.css',
'node_modules/sinon/pkg/sinon.js',
'node_modules/video.js/dist/video.js',
'test/dist/bundle.js'
],
port: 9999,
urlRoot: '/test/',
plugins: [
{'middleware:static': ['factory', StaticMiddlewareFactory]},
'karma-*'
],
middleware: ['static'],
colors: true,
autoWatch: false,
singleRun: true,
concurrency: Infinity,
captureTimeout: 30000,
browserNoActivityTimeout: 300000
});
/* dynamic configuration, for ci and detectBrowsers */
// determine what browsers should be run on this environment
if (process.env.BROWSER_STACK_USERNAME) {
config.browsers = Object.keys(browserstackLaunchers);
} else if (process.env.TRAVIS) {
config.browsers = Object.keys(travisLaunchers);
} else if (process.env.TEAMCITY_VERSION) {
config.browsers = Object.keys(teamcityLaunchers);
}
// if running on travis
if (process.env.TRAVIS) {
config.browserStack.name = process.env.TRAVIS_BUILD_NUMBER;
if (process.env.TRAVIS_PULL_REQUEST !== 'false') {
config.browserStack.name += process.env.TRAVIS_PULL_REQUEST;
config.browserStack.name += ' ';
config.browserStack.name += process.env.TRAVIS_PULL_REQUEST_BRANCH;
}
config.browserStack.name += ' ' + process.env.TRAVIS_BRANCH;
// if running on teamcity
} else if (process.env.TEAMCITY_VERSION) {
config.reporters.push('teamcity');
config.browserStack.name = process.env.TEAMCITY_PROJECT_NAME;
config.browserStack.name += '_';
config.browserStack.name += process.env.BUILD_NUMBER;
}
// If no browsers are specified, we enable `karma-detect-browsers`
// this will detect all browsers that are available for testing
if (config.browsers !== false && !config.browsers.length) {
config.detectBrowsers.enabled = true;
}
config = generate(config);
// any custom stuff here!
};

@@ -1,77 +0,9 @@

/* eslint-disable no-console */
const postcss = require('postcss');
const path = require('path');
const pkg = require('../package.json');
const banner = `@name ${pkg.name} @version ${pkg.version} @license ${pkg.license}`;
const getNow = () => Date.now();
const generate = require('videojs-generate-postcss-config');
let startTime = getNow();
/**
* by default there is no way to print that file was written
* this does that.
*/
const printOutput = postcss.plugin('postcss-print-output', function(opts) {
opts = opts || {};
return function(root, results) {
const relativeFrom = path.relative(process.cwd(), results.opts.from);
const relativeTo = path.relative(process.cwd(), results.opts.to);
console.log(`${relativeFrom} -> ${relativeTo} in ${getNow() - startTime}ms`);
};
});
/**
* A function to set the startTime of postcss so that
* we can print the time taken in the output.
*/
const setTime = postcss.plugin('postcss-set-time', function(opts) {
return function(root, results) {
startTime = getNow();
};
});
module.exports = function(context) {
return {
plugins: [
// set the startTime so that we can print the end time
setTime(),
const result = generate({}, context);
// inlines local file imports
require('postcss-import')(),
// do custom stuff here
// allows you to use newer css features, by converting
// them into something browsers can support now.
// see https://preset-env.cssdb.org/features
// by default we use stage 3+
require('postcss-preset-env')({
browsers: pkg.browserslist,
stage: false,
features: {
// turn `var(xyz)` in the actual value
'custom-properties': {preserve: false, warnings: true},
// flatten nested rules
'nesting-rules': true
}
}),
// adds a banner to the top of the file
require('postcss-banner')({important: true, inline: true, banner}),
// add/remove vendor prefixes based on browser list
require('autoprefixer')(pkg.browserslist),
// minify
require('cssnano')({
safe: true,
preset: ['default', {
autoprefixer: pkg.browserslist
}]
}),
printOutput()
]
};
return result;
};

@@ -1,183 +0,11 @@

/**
* Rollup configuration for packaging the plugin in various formats.
*/
const babel = require('rollup-plugin-babel');
const commonjs = require('rollup-plugin-commonjs');
const json = require('rollup-plugin-json');
const multiEntry = require('rollup-plugin-multi-entry');
const resolve = require('rollup-plugin-node-resolve');
const {uglify} = require('rollup-plugin-uglify');
const {minify} = require('uglify-es');
const pkg = require('../package.json');
const generate = require('videojs-generate-rollup-config');
/* to prevent going into a screen during rollup */
process.stderr.isTTY = false;
// see https://github.com/videojs/videojs-generate-rollup-config
// for options
const options = {};
const config = generate(options);
let isWatch = false;
// Add additonal builds/customization here!
process.argv.forEach((a) => {
if ((/-w|--watch/).test(a)) {
isWatch = true;
}
});
/* configuration for plugins */
const primedPlugins = {
babel: babel({
babelrc: false,
exclude: 'node_modules/**',
presets: [
['env', {loose: true, modules: false, targets: {browsers: pkg.browserslist}}]
],
plugins: [
'external-helpers',
'transform-object-assign'
]
}),
commonjs: commonjs({sourceMap: false}),
json: json(),
multiEntry: multiEntry({exports: false}),
resolve: resolve({browser: true, main: true, jsnext: true}),
uglify: uglify({output: {comments: 'some'}}, minify)
};
/* General Globals */
const moduleName = 'videojsErrors';
const pluginName = 'videojs-errors';
// globals, aka replace require calls with this
const globals = {
umd: {
'video.js': 'videojs',
'global': 'window',
'global/window': 'window',
'global/document': 'document'
},
module: {
'video.js': 'videojs'
},
test: {
'qunit': 'QUnit',
'qunitjs': 'QUnit',
'sinon': 'sinon',
'video.js': 'videojs'
}
};
// externals, aka don't bundle these and if not
// listed as a global don't require them either
const externals = {
umd: Object.keys(globals.umd).concat([
]),
module: Object.keys(globals.module).concat([
'global',
'global/document',
'global/window'
]),
test: Object.keys(globals.test).concat([
])
};
/* plugins that should be used in each bundle with caveats as comments */
const plugins = {
// note uglify will be added before babel for minified bundle
umd: [
primedPlugins.resolve,
primedPlugins.json,
primedPlugins.commonjs,
primedPlugins.babel
],
module: [
primedPlugins.resolve,
primedPlugins.json,
primedPlugins.commonjs,
primedPlugins.babel
],
test: [
primedPlugins.multiEntry,
primedPlugins.resolve,
primedPlugins.json,
primedPlugins.commonjs,
primedPlugins.babel
]
};
/* make a build with the specifed settings */
const makeBuild = (name, settings) => {
const b = Object.assign({}, {
plugins: plugins[name],
external: externals[name],
input: 'src/plugin.js'
}, settings);
const fixOutput = (o) => {
if (!o.banner) {
o.banner = `/*! @name ${pkg.name} @version ${pkg.version} @license ${pkg.license} */`;
}
if (!o.globals) {
o.globals = globals[name];
}
return o;
};
if (!Array.isArray(b.output)) {
b.output = fixOutput(b.output);
} else {
b.output = b.output.map(fixOutput);
}
return b;
};
/* all rollup builds by name. note only object values will be used */
const builds = {
umd: makeBuild('umd', {
output: [{
name: moduleName,
file: `dist/${pluginName}.js`,
format: 'umd'
}]
}),
cjs: makeBuild('module', {
output: [{
file: `dist/${pluginName}.cjs.js`,
format: 'cjs'
}]
}),
es: makeBuild('module', {
output: [{
file: `dist/${pluginName}.es.js`,
format: 'es'
}]
}),
test: makeBuild('test', {
input: 'test/**/*.test.js',
output: [{
name: `${moduleName}Tests`,
file: 'test/dist/bundle.js',
format: 'iife'
}]
})
};
if (!isWatch) {
builds.minUmd = makeBuild('umd', {
output: [{
name: moduleName,
file: `dist/${pluginName}.min.js`,
format: 'umd'
}],
// we need to minify before babel
plugins: plugins.umd
.filter((p) => p !== primedPlugins.babel)
.concat([primedPlugins.uglify, primedPlugins.babel])
});
}
export default Object.values(builds);
// export the builds to rollup
export default Object.values(config.builds);

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

/*! @name videojs-errors @version 4.1.2 @license Apache-2.0 */
/*! @name videojs-errors @version 4.1.3 @license Apache-2.0 */
(function (videojs,QUnit,sinon) {

@@ -37,3 +37,3 @@ 'use strict';

var version = "4.1.2";
var version = "4.1.3";

@@ -40,0 +40,0 @@ var FlashObj = videojs.getComponent('Flash');

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc