Skip to content

Commit

Permalink
feat(FEV-1275): migrate QnA plugin to use V7 player services (#285)
Browse files Browse the repository at this point in the history
* feat(FEV-1275): webpack, dev configs, side-panels

* feat(FEV-1275): post new message with provider

* feat(FEV-1275): handle messages from cue-point manager [wip]

* feat(FEV-1275): handle announcements from cue-point manager

* feat(FEV-1275): handle aoa from cue-point manager[wip]

* feat(FEV-1275): handle aoa from cue-point manager

* feat(FEV-1275): removed kaltura-ts client

* fix(FEV-1256): enable qna only for live entries

* feat(FEV-1275): use UI components from 'common' repo

* feat(FEV-1275): clean-up code and fix banner

* feat(FEV-1275): fix QnA listeners

* feat(FEV-1275): replace svg icons with components

* feat(FEV-1275): tech fix

Co-authored-by: amirch1 <[email protected]>
  • Loading branch information
semarche-kaltura and amirch1 authored Aug 3, 2022
1 parent 27ea20f commit e6fbdf6
Show file tree
Hide file tree
Showing 107 changed files with 11,301 additions and 45,840 deletions.
11 changes: 0 additions & 11 deletions .editorconfig

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.json

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/semantic-pr-title.yml

This file was deleted.

49 changes: 40 additions & 9 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,43 @@
node_modules
# MacOS
.DS_Store
.idea

build/
/.vscode
.rpt2_cache
dist/
# Logs
logs
*.log
npm-debug.log*

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

.rpt2_cache
.rpt2*
stats.json
# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules
jspm_packages

# Optional npm cache directory
.npm
.npmrc

# Optional REPL history
.node_repl_history
.idea
dist/
3 changes: 0 additions & 3 deletions .kaltura-contrib/config.json

This file was deleted.

7 changes: 0 additions & 7 deletions .kaltura-contrib/webpack.config.js

This file was deleted.

11 changes: 7 additions & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
package.json
package-lock.json
dist
build
/dist
/src/index.html
CHANGELOG.md
yarn.lock
yarn-error.log
LICENSE
coverage
12 changes: 12 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"printWidth": 150,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"jsxBracketSameLine": true,
"arrowParens": "avoid",
"proseWrap": "preserve"
}
8 changes: 0 additions & 8 deletions .prettierrc.js

This file was deleted.

19 changes: 17 additions & 2 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:
- '12'
- '14'

addons:
chrome: stable
Expand All @@ -23,6 +23,7 @@ before_install:
script: ./scripts/travis.sh

stages:
# - Tests
- Release canary
- Release
- Deploy
Expand All @@ -32,7 +33,7 @@ jobs:
include:
# https://docs.travis-ci.com/user/build-stages/deploy-github-releases/
- stage: Deploy
name: "Deploying a new version"
name: 'Deploying a new version'
if: tag IS present
env: TRAVIS_MODE=deploy
deploy:
Expand All @@ -56,6 +57,7 @@ jobs:
branch: master
tags: true
- provider: npm
edge: true
api_key: $NPM_TOKEN
email: $NPM_EMAIL
skip_cleanup: true
Expand All @@ -77,3 +79,16 @@ jobs:
branch: master
after_deploy:
- ./scripts/after_deploy.sh "$JENKINS_CANARY_TOKEN"
# Required tests
# - stage: Tests
# if: (branch = master) OR (tag IS present) OR (type = pull_request)
# 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
# - stage: Tests
# if: (branch = master) OR (tag IS present) OR (type = pull_request)
# name: 'Running unit tests'
# env: TRAVIS_MODE=unitTests
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -658,4 +658,4 @@ specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.
115 changes: 84 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,99 @@
# Kaltura Player V7 - Q&A plugin
# PlayKit JS QnA - plugin for the [PlayKit JS Player]

[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
PlayKit JS QnA is written in [ECMAScript6], statically analysed using [Typescript] and transpiled in ECMAScript5 using [Babel].

## Overview
> this section will be added soon
[typescript]: https://www.typescriptlang.org/
[ecmascript6]: https://github.com/ericdouglas/ES6-Learning#articles--tutorials
[babel]: https://babeljs.io

## Project structure
> this section will be added soon
## Getting Started

## Commands
### Prerequisites

The plugin requires [Kaltura Player] to be loaded first.

[kaltura player]: https://github.com/kaltura/kaltura-player-js

### Serve test pages
### Installing

This command will serve test page with your local plugin. It will watch for changes and build them automatically.
First, clone and run [yarn] to install dependencies:

```$xslt
npm run serve // served on http://localhost:8007
```
[yarn]: https://yarnpkg.com/lang/en/

#### Serve command pre-requisite
Until the cli library will be ready, you will need to manually create the test page, using the following guide:
1. open folder `test` and copy file `test/index.template.ejs` as `test/index.ejs`
2. open `index.ejs` file and fill all places marked with `TODO` comment.
```
git clone https://github.com/kaltura/playkit-js-qna.git
cd playkit-js-qna
yarn install
```

### Build packages
This command will build the plugin create dist folder with relevant assets
### Building

```$xslt
npm run build // dist folder will be created under `dist`
```
Then, build the player

### Analyze packages bundle
This command will build and create a static page visualizing the bundle content.
```javascript
yarn run build
```

```$xslt
npm run analyze // for plugin v7 bundle analyze to be shown automatically in the browser
```
### Embed the library in your test page

### Update Player Contrib libraries
This command will update packages to use `latest` or `next` version of the player contrib libraries.
Finally, add the bundle as a script tag in your page, and initialize the player

```$xslt
npm run upgrade:latest // upgrade contrib libraries to latest version
npm run upgrade:next // upgrade contrib libraries to next version
```html
<script type="text/javascript" src="/PATH/TO/FILE/kaltura-player.js"></script>
<!--Kaltura player-->
<script type="text/javascript" src="/PATH/TO/FILE/playkit-qna.js"></script>
<!--PlayKit qna plugin-->
<div id="player-placeholder" style="height:360px; width:640px">
<script type="text/javascript">
var playerContainer = document.querySelector("#player-placeholder");
var config = {
...
targetId: 'player-placeholder',
plugins: {
qna: { ... }
}
...
};
var player = KalturaPlayer.setup(config);
player.loadMedia(...);
</script>
</div>
```

## Documentation

QnA plugin configuration can been found here:

- **[Configuration](docs/configuration.md)**

### And coding style tests

We use ESLint [recommended set](http://eslint.org/docs/rules/) with some additions for enforcing [Flow] types and other rules.

See [ESLint config](.eslintrc.json) for full configuration.

We also use [.editorconfig](.editorconfig) to maintain consistent coding styles and settings, please make sure you comply with the styling.


## Versioning

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/kaltura/playkit-js-qna/tags).

## License

This project is licensed under the AGPL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details

## Commands

Run dev server: `npm run serve`;<br/>
Update contrib: `npm run infra:latest`;<br/>
Bump version: `npm run deploy:prepare`;<br/>

## Configuration

Plugin configuration:<br/>
> bannerDuration: number;<br/>
> toastDuration: number;<br/>
> dateFormat: string;<br/>
> expandMode: string;<br/>
> expandOnFirstPlay: boolean;<br/>
6 changes: 0 additions & 6 deletions commitlint.config.js

This file was deleted.

Binary file not shown.
Loading

0 comments on commit e6fbdf6

Please sign in to comment.