# europeanamediaplayer

> [![Build Status](https://travis-ci.com/europeana/media-player.svg?branch=master)](https://travis-ci.com/europeana/media-player) [![Maintainability](https://api.codeclimate.com/v1/badges/034304037fa168609682/maintainability)](https://codeclimate.com/github

Latest version **0.6.0** (published 2020-05-08) · EUPL-1.2 license · 0 weekly downloads

## Install

```sh
npm install europeanamediaplayer
pnpm add europeanamediaplayer
yarn add europeanamediaplayer
bun add europeanamediaplayer
```

## Health

**Score 5/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle; pre 1.0.

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2020-05-08 |
| First published | 2020-02-18 |
| Weekly downloads | 0 |
| License | EUPL-1.2 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 29 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | Pieter van Leeuwen |
| Maintainers | andyjmaclean, pietervanleeuwen |

## Links

- npm: https://www.npmjs.com/package/europeanamediaplayer
- Repository: https://github.com/europeana/media-player
- Homepage: https://github.com/europeana/media-player#readme
- Issues: https://github.com/europeana/media-player/issues
- npm.io page: https://npm.io/package/europeanamediaplayer

## Dependencies (9)

- [dashjs](https://npm.io/package/dashjs.md) ^2.9.3
- [dotenv](https://npm.io/package/dotenv.md) ^8.0.0
- [jquery](https://npm.io/package/jquery.md) ^3.3.1
- [banana-i18n](https://npm.io/package/banana-i18n.md) ^1.2.1
- [@iiif/manifold](https://npm.io/package/@iiif/manifold.md) ^2.0.2
- [webpack-jquery-ui](https://npm.io/package/webpack-jquery-ui.md) ^2.0.1
- [@iiif/base-component](https://npm.io/package/@iiif/base-component.md) ^2.0.1
- [@iiif/iiif-av-component](https://npm.io/package/@iiif/iiif-av-component.md) github:Noterik/iiif-av-component#build2
- [@iiif/iiif-tree-component](https://npm.io/package/@iiif/iiif-tree-component.md) ^2.0.2

## Recent versions

- 0.6.0 (latest) — 2020-05-08
- 0.5.25 — 2020-04-10
- 0.5.24 — 2020-04-10
- 0.5.23 — 2020-04-10
- 0.5.22 — 2020-04-10
- 0.5.21 — 2020-04-10
- 0.5.20 — 2020-04-10
- 0.5.19 — 2020-04-10
- 0.5.18 — 2020-04-10
- 0.5.17 — 2020-04-09
- 0.5.16 — 2020-04-08
- 0.5.14 — 2020-04-08
- 0.5.13 — 2020-04-08
- 0.5.12 — 2020-04-08
- 0.5.10 — 2020-04-02
- … 18 more at https://npm.io/package/europeanamediaplayer/versions

## README

# Europeana Media Player Library

[![Build Status](https://travis-ci.com/europeana/media-player.svg?branch=master)](https://travis-ci.com/europeana/media-player)
[![Maintainability](https://api.codeclimate.com/v1/badges/034304037fa168609682/maintainability)](https://codeclimate.com/github/europeana/media-player/maintainability)

Created as part of the [Europeana Media Project](https://pro.europeana.eu/project/europeana-media)

### Build Setup

Install package dependencies:
* `npm install`

### Linting
To lint-check the `.js` run:
* `npm run lint`
* `npm run lint:fix`

To lint-check the `.scss` run:

* `npm run lint:style`
* `npm run lint:style:fix`

### Testing

Run unit tests with either of:
* `npm run test`
* `npm test`

Generate a coverage report with:
* `npm run test:coverage`

Run an accessibility test with:
* `npm run test:accessibility`

Run end-to-end tests with:
* `npm run test:e2e`
(defaults to chrome) or with the browser-specific commands:
* `npm run test:e2e:chrome`
* `npm run test:e2e:firefox`
* `npm run test:e2e:chrome:headless`
* `npm run test:e2e:firefox:headless`
* `npm run test:e2e:headless`
* `npm run test:e2e:all`

### Build for production

Run:
* `npm run build:production`

### Publication

* publishes to [npm](https://www.npmjs.com/package/europeanamediaplayer) using a [web-action](actions?query=workflow%3A%22Node.js+Package%22)

### Dependencies

The player has unbundled dependencies on [jQuery](https://www.npmjs.com/package/jquery) and [jQuery-UI](https://www.npmjs.com/package/webpack-jquery-ui) that have not been packed into this library. Further [dashjs](https://www.npmjs.com/package/dashjs) is needed if you plan to stream MPEG DASH videos.

### Embed player

To embed the player please firstyourself first make sure to include the Europeana Media Player Library

```javascript
import EuropeanaMediaPlayer from 'europeanamediaplayer';
```

or

```javascript
const EuropeanaMediaPlayer = require("europeanamediaplayer").default;
```

The constructor of the Europeana Media Player is

```javascript
var player = new EuropeanaMediaPlayer(container, videoObject[, options]);
```

The constructor accepts the following parameters

Name | Type | Description
---- | ---- | -----------
container| _DOM Element_ | the DOM element in which to create the player
videoObject | _JSON Object_ | the object containing the video properties
options | _JSON Object_ | an optional object containing the player options

The _videoObject_ requires the following property

Name | Type | Description
---- | ---- | -----------
manifest | _String_ | the url of the IIIF manifest for the media item

The _options_ accepts the following properties

Name | Type | Description
---- | ---- | -----------
editor | _String_ | url, allows to configure an external editor so that embedding and other editorial options can be done on that page
language | _String_ | 2 character [iso 639-1 language code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), all official languages of the European Union are supported. The default language is English

### Examples

#### Basic example

This basic example contains only the required parameters.

```javascript
var container = document.body;
var videoObj = { manifest : "https://iiif.europeana.eu/presentation/2051906/data_euscreenXL_http___openbeelden_nl_media_9972/manifest?format=3" };
new EuropeanaMediaPlayer(container, videoObj);
```

#### Editor example

This example sets the editor to show the editorial option menu in the player.

```javascript
var container = document.body;
var videoObj = { manifest : "https://iiif.europeana.eu/presentation/2051906/data_euscreenXL_http___openbeelden_nl_media_9972/manifest?format=3" };
var options = { editor: "https://video-editor.eu" };
new EuropeanaMediaPlayer(container, videoObj, options);
```

#### Editor and language example

This example sets besides the editor the player interface language to Dutch

```javascript
var container = document.body;
var videoObj = { manifest : "https://iiif.europeana.eu/presentation/2051906/data_euscreenXL_http___openbeelden_nl_media_9972/manifest?format=3" };
var options = { editor: "https://video-editor.eu", language: "nl" };
new EuropeanaMediaPlayer(container, videoObj, options);
```

## License

Licensed under the EUPL v1.2.

For full details, see [LICENSE.md](LICENSE.md).

---
_Source: https://npm.io/package/europeanamediaplayer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
