Skip to content

Commit

Permalink
feat(FEC-10290): upgrade NPM packages (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv committed Jul 26, 2020
1 parent 463be97 commit 136926f
Show file tree
Hide file tree
Showing 20 changed files with 5,836 additions and 3,675 deletions.
23 changes: 12 additions & 11 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{
"presets": [
"es2015"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties"
],
"env": {
"test": {
"plugins": [
"istanbul"
]
"plugins": ["istanbul"]
}
}
},
"ignore": ["node_modules/**/*"],
"plugins": [
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-flow-strip-types",
"@babel/plugin-transform-property-mutators",
"@babel/plugin-proposal-object-rest-spread",
"@babel/plugin-proposal-class-properties",
"@babel/plugin-transform-classes",
],
"presets": ["@babel/preset-env", "@babel/preset-flow"]
}
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/flow-typed/**/*.js
/coverage
/dist
karma.conf.js
webpack.config.js

4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"should": true,
"sinon": true,
"__VERSION__": true,
"__NAME__": true
"__NAME__": true,
"process": true,
"__dirname": true
},
"rules": {
"prettier/prettier": "error",
Expand Down
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@
[libs]
node_modules/@playkit-js/playkit-js/flow-typed/
[options]
unsafe.enable_getters_and_setters=true
18 changes: 12 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
<!-- If you are raising a bug playing a stream, you must fill out the following or your issue may not be responded to. For features or improvements, you may delete this. -->

##### Prerequisites
- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js-dash/issues): ______
- [ ] Which Plugin [version](https://github.com/kaltura/playkit-js-dash/releases) are you using: ______
- [ ] Can you reproduce the issue with our latest release version: ______
- [ ] Can you reproduce the issue with the latest code from master: ______
- [ ] What browser and OS names and versions are you using: ______
- [ ] If applicable, add test code or test page to reproduce:

- [ ] Have you checked for duplicate [issues](https://github.com/kaltura/playkit-js-dash/issues): **\_\_**
- [ ] Which Plugin [version](https://github.com/kaltura/playkit-js-dash/releases) are you using: **\_\_**
- [ ] Can you reproduce the issue with our latest release version: **\_\_**
- [ ] Can you reproduce the issue with the latest code from master: **\_\_**
- [ ] What browser and OS names and versions are you using: **\_\_**
- [ ] If applicable, add test code or test page to reproduce:

```
Paste test code here
```

##### Expected behavior

What you expected to happen

##### Actual behavior

What actually happened

##### Console output

```
Paste the contents of the browser console here.
```
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ CHANGELOG.md
yarn.lock
yarn-error.log
LICENSE
coverage
20 changes: 10 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ sudo: required
dist: xenial
language: node_js
node_js:
- "node"
- 'node'

addons:
chrome: stable
Expand All @@ -16,8 +16,8 @@ cache:
- node_modules

before_install:
- export DISPLAY=:99.0
- chmod +x ./scripts/travis.sh
- export DISPLAY=:99.0
- chmod +x ./scripts/travis.sh

script: ./scripts/travis.sh

Expand All @@ -31,7 +31,7 @@ jobs:
include:
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Release
name: "Releasing a new version"
name: 'Releasing a new version'
if: tag IS present
env: TRAVIS_MODE=release
deploy:
Expand Down Expand Up @@ -69,13 +69,13 @@ jobs:
# Required tests
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running lint"
env: TRAVIS_MODE=lint
name: 'Running lint'
env: TRAVIS_MODE=lint
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running Flow type check"
env: TRAVIS_MODE=flow
name: 'Running Flow type check'
env: TRAVIS_MODE=flow
- stage: Tests
if: (branch = master) OR (tag IS present) OR (type = pull_request)
name: "Running unit tests"
env: TRAVIS_MODE=unitTests
name: 'Running unit tests'
env: TRAVIS_MODE=unitTests
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ Finally, add the bundle as a script tag in your page, and initialize the player
<script type="text/javascript" src="/PATH/TO/FILE/playkit.js"></script>
<script type="text/javascript" src="/PATH/TO/FILE/playkit-dash.js"></script>
<div id="player-placeholder" style="height:360px; width:640px">
<script type="text/javascript">
var playerContainer = document.querySelector("#player-placeholder");
var config = {...};
var player = playkit.core.loadPlayer(config);
playerContainer.appendChild(player.getView());
player.play();
</script>
<script type="text/javascript">
var playerContainer = document.querySelector("#player-placeholder");
var config = {...};
var player = playkit.core.loadPlayer(config);
playerContainer.appendChild(player.getView());
player.play();
</script>
</div>
```

## Configuration
Expand Down
7 changes: 2 additions & 5 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const customLaunchers = {
}
};

module.exports = function(config) {
module.exports = function (config) {
let karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'Firefox'],
Expand All @@ -27,10 +27,7 @@ module.exports = function(config) {
'src/**/*.js': ['webpack', 'sourcemap'],
'test/setup/karma.js': ['webpack', 'sourcemap']
},
reporters: [
'mocha',
'coverage'
],
reporters: ['mocha', 'coverage'],
webpack: webpackConfig,
webpackServer: {
noInfo: true
Expand Down
95 changes: 51 additions & 44 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
"scripts": {
"clean": "rm -rf ./dist",
"prebuild": "npm run clean",
"build": "NODE_ENV=production webpack",
"dev": "webpack-dev-server",
"watch": "webpack --progress --colors --watch",
"test": "NODE_ENV=test karma start --color",
"build": "webpack --mode production",
"dev": "webpack-dev-server --mode development",
"watch": "webpack --progress --colors --watch --mode development",
"test": "NODE_ENV=test karma start --color --mode development",
"release": "standard-version",
"pushTaggedRelease": "git push --follow-tags --no-verify origin master",
"eslint": "eslint . --color",
"flow": "flow check",
"precommit": "lint-staged"
"precommit": "lint-staged",
"prettier:fix": "prettier --write ."
},
"lint-staged": {
"*.{js,jsx}": [
Expand All @@ -30,54 +31,60 @@
"access": "public"
},
"devDependencies": {
"@playkit-js/playkit-js": "^0.62.1-canary.28e7dd3",
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.7",
"babel-plugin-istanbul": "^4.0.0",
"babel-plugin-transform-class-properties": "^6.22.0",
"babel-plugin-transform-flow-strip-types": "^6.22.0",
"babel-preset-es2015": "^6.18.0",
"babel-register": "^6.23.0",
"chai": "^3.5.0",
"cross-env": "^3.1.4",
"eslint": "^3.10.0",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-mocha-no-only": "^0.0.5",
"eslint-plugin-prettier": "^2.6.2",
"flow-bin": "0.53.1",
"husky": "^0.14.3",
"@babel/cli": "^7.10.5",
"@babel/core": "^7.10.5",
"@babel/plugin-proposal-class-properties": "^7.10.4",
"@babel/plugin-proposal-object-rest-spread": "^7.10.4",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-classes": "^7.10.4",
"@babel/plugin-transform-flow-strip-types": "^7.10.4",
"@babel/plugin-transform-property-mutators": "^7.10.4",
"@babel/preset-env": "^7.10.4",
"@babel/preset-flow": "^7.10.4",
"@babel/register": "^7.10.5",
"@playkit-js/playkit-js": "0.62.1-canary.724715e",
"babel-eslint": "^10.1.0",
"babel-loader": "^8.1.0",
"babel-plugin-istanbul": "^6.0.0",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"eslint": "^7.4.0",
"eslint-config-prettier": "^6.11.0",
"eslint-loader": "^4.0.2",
"eslint-plugin-flowtype": "^5.2.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-mocha-no-only": "^1.1.0",
"eslint-plugin-prettier": "^3.1.4",
"flow-bin": "^0.129.0",
"husky": "^4.2.5",
"istanbul": "^0.4.5",
"karma": "^1.5.0",
"karma": "^5.1.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage": "^2.0.2",
"karma-firefox-launcher": "^1.3.0",
"karma-ie-launcher": "^1.0.0",
"karma-mocha": "^1.3.0",
"karma-mocha": "^2.0.1",
"karma-mocha-reporter": "^2.2.5",
"karma-safari-launcher": "^1.0.0",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.2",
"lint-staged": "^7.2.0",
"mocha": "^3.2.0",
"karma-webpack": "^4.0.2",
"lint-staged": "^10.2.11",
"mocha": "^8.0.1",
"mocha-cli": "^1.0.1",
"prettier": "^1.13.7",
"shaka-player": "^2.5.9",
"sinon": "^2.0.0",
"sinon-chai": "^2.8.0",
"standard-version": "^4.0.0",
"uglifyjs-webpack-plugin": "^0.4.3",
"webpack": "latest",
"webpack-dev-server": "latest"
"prettier": "^2.0.5",
"shaka-player": "2.5.9",
"sinon": "^9.0.2",
"sinon-chai": "^3.5.0",
"standard-version": "^8.0.2",
"uglifyjs-webpack-plugin": "^2.2.0",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^3.11.0"
},
"peerDependencies": {
"@playkit-js/playkit-js": "^0.62.1-canary.28e7dd3",
"@playkit-js/playkit-js": "0.62.1-canary.2264c8f",
"shaka-player": "^2.5.5"
},
"keywords": [
Expand Down
12 changes: 8 additions & 4 deletions src/dash-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
* @type {null|number}
* @private
*/
_videoSizeUpdateTimer: ?number = null;
_videoSizeUpdateTimer: ?IntervalID = null;

/**
* 3016 is the number of the video error at shaka, we already listens to it in the html5 class
Expand Down Expand Up @@ -332,7 +332,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
_setShakaConfig(): void {
const textDisplayerConfig = {
shakaConfig: {
textDisplayFactory: function(videoEl) {
textDisplayFactory: function (videoEl) {
return new TextDisplayer(videoEl);
}.bind(null, this._videoElement)
}
Expand Down Expand Up @@ -462,7 +462,11 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
_maybeApplyAbrRestrictions(): void {
if (this._config.capLevelToPlayerSize) {
const videoTracks = this._getVideoTracks();
const getMinDimensions = (dim): number => Math.min.apply(null, videoTracks.map(variant => variant[dim]));
const getMinDimensions = (dim): number =>
Math.min.apply(
null,
videoTracks.map(variant => variant[dim])
);
//Get minimal allowed dimensions
const minWidth = getMinDimensions('width');
const minHeight = getMinDimensions('height');
Expand Down Expand Up @@ -944,7 +948,7 @@ export default class DashAdapter extends BaseMediaSourceAdapter {
* @private
*/
_onAdaptation(): void {
let selectedVideoTrack = this._getParsedVideoTracks().filter(function(videoTrack) {
let selectedVideoTrack = this._getParsedVideoTracks().filter(function (videoTrack) {
return videoTrack.active;
})[0];
DashAdapter._logger.debug('Video track changed', selectedVideoTrack);
Expand Down
10 changes: 5 additions & 5 deletions src/drm/playready.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @flow
import {IDrmProtocol, getLogger, DrmScheme} from '@playkit-js/playkit-js';
import {IDrmProtocol, DrmScheme, getLogger} from '@playkit-js/playkit-js';

const _logger = getLogger('PlayReady');
const PlayReady: IDrmProtocol = class PlayReady {
static _logger = getLogger('PlayReady');

const PlayReady: IDrmProtocol = class _PlayReady {
/**
* PLAYREADY is the configure key system.
* @param {Array<Object>} drmData - The drm data.
Expand All @@ -22,7 +22,7 @@ const PlayReady: IDrmProtocol = class _PlayReady {
* @return {boolean} - Whether PlayReady can be play on the current environment.
*/
static canPlayDrm(drmData: Array<Object>): boolean {
_logger.debug('Can play DRM scheme of: ' + DrmScheme.PLAYREADY);
PlayReady._logger.debug('Can play DRM scheme of: ' + DrmScheme.PLAYREADY);
return !!drmData.find(drmEntry => drmEntry.scheme === DrmScheme.PLAYREADY);
}

Expand All @@ -33,7 +33,7 @@ const PlayReady: IDrmProtocol = class _PlayReady {
* @returns {void}
*/
static setDrmPlayback(config: Object, drmData: Array<Object>): void {
_logger.debug('Sets drm playback');
PlayReady._logger.debug('Sets drm playback');
let prDrmEntry = drmData.find(drmEntry => drmEntry.scheme === DrmScheme.PLAYREADY);
if (prDrmEntry) {
config.drm = {
Expand Down
Loading

0 comments on commit 136926f

Please sign in to comment.