React Component for Google Shaka Player
import { ShakaVideo } from '@opnay/react-shaka';
const VIDEO = 'https://storage.googleapis.com/shaka-demo-assets/bbb-dark-truths/dash.mpd';
const component: React.FunctionComponent = () => {
return <ShakaVideo autoplay uri={VIDEO} onLoad={() => console.log('loaded')} />;
};
<!-- Will render like this -->
<video class="shaka" autoplay="" src="blob:https://localhost:3000/2c210555-bc5d-4518-9869-8aee4ffaa08d"></video>
See more info here(storybook)
I don't publish to npm registry. only for github packages.
(npm registry has limit for private scoped packages for free.)
Generate access token
- Your Github Settings
- Developer Settings
- Personal access tokens
- Generate new token
- write token name and check
repo
andread:packages
- copy token and don't forget this. (Can't find it)
npm login --registry=https://npm.pkg.github.com
# Username: ${your github username}
# Password: ${your personal access token}
# Email: (this IS public) ${your github email}
# Logged in as ${Username} on https://npm.pkg.github.com/.
# /path/to/project/.npmrc(recommend) or ~/.npmrc
@opnay:registry=https://npm.pkg.github.com
npm install @opnay/react-shaka
# or
yarn add @opnay/react-shaka