# jwplayer.js

> Jwplayer promise implementation for npm package. CommonJS Pattern

Latest version **1.0.1** (published 2020-10-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install jwplayer.js
pnpm add jwplayer.js
yarn add jwplayer.js
bun add jwplayer.js
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-10-11 |
| First published | 2020-10-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | juanpablocs |
| Maintainers | juanpablocs |
| Keywords | jwplayer, jwplayer.js |

## Links

- npm: https://www.npmjs.com/package/jwplayer.js
- Repository: https://github.com/juanpablocs/jwplayer.js
- Homepage: https://github.com/juanpablocs/jwplayer.js#readme
- Issues: https://github.com/juanpablocs/jwplayer.js/issues
- npm.io page: https://npm.io/package/jwplayer.js

## Recent versions

- 1.0.1 (latest) — 2020-10-11
- 1.0.0 — 2020-10-11

## README

# Jwplayer

Wrapper Promise of jwplayer for npm packages

```js
import jwplayer from 'jwplayer.js';

const setup = {
  file: 'https://raw.githubusercontent.com/juanpablocs/react-vplayer/master/demo/video/720p.mp4',
  type: "video/mp4",
  width: window.innerWidth,
  height: window.innerHeight,
};

(async () => {
  try {
    const player = await jwplayer('video-id'); // jwplayer library instance
    player.setup(setup);
  }catch(e) {
    console.log('err', e);
  }

})();
```

## React implementation

```js
import React from "react";
import jwplayer from 'jwplayer.js';

export default function App() {
  const playerRef = React.createRef(null);

  React.useEffect(() => {
    let player;
    async function loadPlayer() {
      player = await jwplayer(playerRef.current); //jwplayer library instance
      player.setup({
        file: 'https://raw.githubusercontent.com/juanpablocs/react-vplayer/master/demo/video/720p.mp4',
        type: "video/mp4",
        width: 300,
        height: 180
      });
    }
    loadPlayer();
    return () => {
      player.destroy();
    }
  }, []);

  return (
    <div className="App">
      <div ref={playerRef} id='player'></div>
    </div>
  );
}
```

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