https://github.com/kaltura/playkit-js-youtube
YouTube Engine for the PlayKit JS Player
https://github.com/kaltura/playkit-js-youtube
Last synced: 3 days ago
JSON representation
YouTube Engine for the PlayKit JS Player
- Host: GitHub
- URL: https://github.com/kaltura/playkit-js-youtube
- Owner: kaltura
- License: agpl-3.0
- Created: 2019-01-13T07:33:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2025-09-11T15:04:44.000Z (about 1 month ago)
- Last Synced: 2025-09-11T18:23:03.644Z (about 1 month ago)
- Language: JavaScript
- Size: 1.25 MB
- Stars: 3
- Watchers: 18
- Forks: 1
- Open Issues: 33
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# PlayKit JS YouTube - YouTube Engine for the [PlayKit JS Player]
[](https://github.com/kaltura/playkit-js-youtube/actions/workflows/run_canary_full_flow.yaml)
[](https://www.npmjs.com/package/@playkit-js/playkit-js-youtube)
[](https://www.npmjs.com/package/@playkit-js/playkit-js-youtube/v/canary)PlayKit JS YouTube Engine integrates youtube with the [PlayKit JS Player].
PlayKit JS YouTube is written in [ECMAScript6], statically analysed using [Flow] and transpiled in ECMAScript5 using [Babel].
[youtube iframe api]: https://developers.google.com/youtube/iframe_api_reference
[flow]: https://flow.org/
[ecmascript6]: https://github.com/ericdouglas/ES6-Learning#articles--tutorials
[babel]: https://babeljs.io## Getting Started
### Prerequisites
The adapter requires [PlayKit JS Player] to be loaded first.
The engine uses the [YouTube Iframe API] javascript library.
[playkit js player]: https://github.com/kaltura/playkit-js
### Installing
First, clone and run [yarn] to install dependencies:
[yarn]: https://yarnpkg.com/lang/en/
```
git clone https://github.com/kaltura/playkit-js-youtube.git
cd playkit-js-youtube
yarn install
```### Building
Then, build the player
```javascript
yarn run build
```### Embed the library in your test page
Finally, add the bundle as a script tag in your page, and initialize the player
```html
var playerContainer = document.querySelector("#player-placeholder");
var config = {...};
var player = playkit.core.loadPlayer(config);
playerContainer.appendChild(player.getView());
player.play();```
## Configuration
[YouTube Iframe API] configuration options, can be passed via the [PlayKit JS Player] config.
The configuration is exposed via the playback section:
```javascript
{
playback: {
options: {
youtube: {
// YouTube Iframe configuration options here
}
}
}
}
```## Running the tests
Tests can be run locally via [Karma], which will run on Chrome, Firefox and Safari
[karma]: https://karma-runner.github.io/1.0/index.html
```
yarn run test
```You can test individual browsers:
```
yarn run test:chrome
yarn run test:firefox
yarn run test:safari
```### 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.
## Compatibility
TBD
## Contributing
Please read [CONTRIBUTING.md](https://gist.github.com/PurpleBooth/b24679402957c63ec426) for details on our code of conduct, and the process for submitting pull requests to us.
## 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-youtube/tags).
## License
This project is licensed under the AGPL-3.0 License - see the [LICENSE.md](LICENSE.md) file for details