1.0.1 • Published 5 years ago
react-hooks-jwplayer v1.0.1
JW Player React Hook
This is a very simple implementation of JW Player with React hooks.
example:
import React, { useRef } from "react";
import useJWPlayer from "react-hooks-jwplayer";
function JWPlayer({ libraryId, playerId, config }) {
const playerRef = useRef(null);
useJWPlayer({ playerRef, libraryId, mediaId, ...config });
return <div ref={playerRef} />;
}