Skip to content

Commit

Permalink
feat(FEC-10290): upgrade NPM packages (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Ziv authored Jul 27, 2020
1 parent b3eaabe commit a3ba719
Show file tree
Hide file tree
Showing 20 changed files with 6,649 additions and 6,399 deletions.
25 changes: 16 additions & 9 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
{
"presets": [
"es2015"
],
"plugins": [
"transform-flow-strip-types",
"transform-class-properties",
"transform-object-rest-spread"
],
"env": {
"test": {
"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"
]
}
1 change: 0 additions & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
[include]
[libs]
[options]
unsafe.enable_getters_and_setters=true
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/dist
dist
yarn.lock
/src/index.html
CHANGELOG.md
LICENSE
coverage
16 changes: 8 additions & 8 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 Down Expand Up @@ -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 @@ -76,13 +76,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
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-cayman
theme: jekyll-theme-cayman
2 changes: 1 addition & 1 deletion dist/playkit-cast-receiver.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/playkit-cast-receiver.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
theme: jekyll-theme-slate
theme: jekyll-theme-slate
38 changes: 19 additions & 19 deletions docs/create-basic-receiver-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The following is the main structure of a basic receiver app, which has no custom

```html
<body>
<cast-media-player/>
<cast-media-player />
</body>
```

Expand All @@ -27,24 +27,24 @@ The following is the minimum code for a receiver application without any customi
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player/>
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
receiver.start();
</script>
</body>
<head>
<meta charset="UTF-8" />
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player />
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
receiver.start();
</script>
</body>
</html>
```

Expand Down
154 changes: 77 additions & 77 deletions docs/features-to-your-receiver-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,96 +13,96 @@ If you want to manipulate or change the data that is sent by the sender, you can

#### Examples

* **Intercept Google home request and translate the received url to media ID:**
- **Intercept Google home request and translate the received url to media ID:**

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player/>
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
// Kaltura receiver player
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
// Google cast player manager
var playerManager = cast.framework.CastReceiverContext.getInstance().getPlayerManager();
// Set the load interceptor
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, requestData => {
var mediaID = requestData.media.entity.split("/").pop();
if (!mediaID && mediaID.length === 0){
var trimmedURL = requestData.media.entity.replace(/^[\/]+|[\/]+$/g, "");
mediaID = trimmedURL.split("/").pop();
}
// Set the media ID in the receiver's custom data
requestData.media.customData = requestData.media.customData || {};
requestData.media.customData.mediaInfo = {
entryId: mediaID,
formats:["Web New"]
};
// Must return the manipulated data to the receiver default load handler!
return receiver.onLoad(requestData);
});
receiver.start();
</script>
</body>
<head>
<meta charset="UTF-8" />
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player />
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
// Kaltura receiver player
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
// Google cast player manager
var playerManager = cast.framework.CastReceiverContext.getInstance().getPlayerManager();
// Set the load interceptor
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, requestData => {
var mediaID = requestData.media.entity.split('/').pop();
if (!mediaID && mediaID.length === 0) {
var trimmedURL = requestData.media.entity.replace(/^[\/]+|[\/]+$/g, '');
mediaID = trimmedURL.split('/').pop();
}
// Set the media ID in the receiver's custom data
requestData.media.customData = requestData.media.customData || {};
requestData.media.customData.mediaInfo = {
entryId: mediaID,
formats: ['Web New']
};
// Must return the manipulated data to the receiver default load handler!
return receiver.onLoad(requestData);
});
receiver.start();
</script>
</body>
</html>
```

* **Set default VMAP ad tag in case not sent from the sender:**
- **Set default VMAP ad tag in case not sent from the sender:**

```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player/>
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
// Kaltura receiver player
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
// Google cast player manager
var playerManager = cast.framework.CastReceiverContext.getInstance().getPlayerManager();
// Set the load interceptor
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, requestData => {
if (!requestData.media.vmapAdsRequest) {
requestData.media.vmapAdsRequest = {
adTagUrl: 'your_ad_tag_url';
};
}
// Must return the manipulated data to the receiver default load handler!
return receiver.onLoad(requestData);
});
receiver.start();
</script>
</body>
<head>
<meta charset="UTF-8" />
<script src="//www.gstatic.com/cast/sdk/libs/caf_receiver/v3/cast_receiver_framework.js"></script>
<script src="//cdnapisec.kaltura.com/p/{YOUR_PARTNER_ID}/embedPlaykitJs/uiconf_id/{UI_CONF_ID}"></script>
</head>
<body>
<cast-media-player />
<script>
var conf = {
provider: {
partnerId: {YOUR_PARTNER_ID},
uiConfId: {UI_CONF_ID} // receiver type
}
};
// Kaltura receiver player
var receiver = new KalturaPlayer.cast.receiver.Receiver(conf);
// Google cast player manager
var playerManager = cast.framework.CastReceiverContext.getInstance().getPlayerManager();
// Set the load interceptor
playerManager.setMessageInterceptor(cast.framework.messages.MessageType.LOAD, requestData => {
if (!requestData.media.vmapAdsRequest) {
requestData.media.vmapAdsRequest = {
adTagUrl: 'your_ad_tag_url';
};
}
// Must return the manipulated data to the receiver default load handler!
return receiver.onLoad(requestData);
});
receiver.start();
</script>
</body>
</html>
```


> **Important**: You must return the `receiver.onLoad` default handler from the `LOAD` interceptor callback function with the manipulated data, otherwise this won't work!
### Set Your Preferred Streaming Protocol
Expand Down
6 changes: 3 additions & 3 deletions karma.conf.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let webpackConfig = require('./webpack.config.js');
const webpackConfig = require('./webpack.config.js');
//Need to remove externals otherwise they won't be included in test
delete webpackConfig.externals;
// Need to define inline source maps when using karma
Expand All @@ -14,8 +14,8 @@ const customLaunchers = {
}
};

module.exports = function(config) {
let karmaConf = {
module.exports = config => {
const karmaConf = {
logLevel: config.LOG_INFO,
browsers: ['Chrome', 'Firefox'],
concurrency: 1,
Expand Down
Loading

0 comments on commit a3ba719

Please sign in to comment.