Gathering detailed insights and metrics for shaka-player-react
Gathering detailed insights and metrics for shaka-player-react
Gathering detailed insights and metrics for shaka-player-react
Gathering detailed insights and metrics for shaka-player-react
A simple React component wrapper for shaka-player
npm install shaka-player-react
Typescript
Module System
Node Version
NPM Version
JavaScript (96.01%)
HTML (3.99%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
116 Stars
51 Commits
36 Forks
4 Watchers
4 Branches
2 Contributors
Updated on May 29, 2025
Latest Version
1.1.5
Package Id
shaka-player-react@1.1.5
Unpacked Size
541.62 kB
Size
165.70 kB
File Count
14
NPM Version
8.5.1
Node Version
17.6.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
11
A React component for Shaka Player, an open-source JavaScript library for adaptive media. It is highly recommended to check the official shaka documentation first.
npm install shaka-player-react --save
yarn add shaka-player-react
As seen in the example below, the CSS bundled with shaka-player
has been imported separately. This is because shaka-player-react
does not require any CSS internally, which keeps you in full control of the styling as if you were not using this React wrapper.
1import React from 'react'; 2import ShakaPlayer from 'shaka-player-react'; 3import 'shaka-player/dist/controls.css'; 4 5function App() { 6 return <ShakaPlayer autoPlay src="https://streams.com/example.mpd" />; 7}
The following ShakaPlayer
properties are supported:
Property | Description | Type |
---|---|---|
src | The MPEG-DASH, or HLS media asset. Is provided to shaka.Player.load on mount or change. | String |
autoPlay | Whether the asset should autoplay or not, directly bound to the HTMLVideoElement element. | Boolean |
width | Width of the player. | Number |
height | Height of the player. | Number |
playbackRate | Sets the speed of the audio/video playback. | Number |
muted | Sets whether the video is muted or not | Boolean |
loop | Sets whether teh audio/video should start over again when finished | Boolean |
volume | Sets the volume of the audio/video | Number |
className | Adds a class to the root element, which is a div. | String |
The following is a more advanced setup to illustrate how you can integrate shaka's features in React.
1import React, { useRef, useEffect } from 'react'; 2import ShakaPlayer from 'shaka-player-react'; 3 4function App() { 5 const controllerRef = useRef(null); 6 7 useEffect(() => { 8 const { 9 /** @type {shaka.Player} */ player, 10 /** @type {shaka.ui.Overlay} */ ui, 11 /** @type {HTMLVideoElement} */ videoElement 12 } = controllerRef.current; 13 14 async function loadAsset() { 15 // Load an asset. 16 await player.load('https://streams.com/example.mpd'); 17 18 // Trigger play. 19 videoElement.play(); 20 } 21 22 loadAsset(); 23 }, []); 24 25 return <ShakaPlayer ref={controllerRef} />; 26}
Or check the example in this repository.
1import React from 'react'; 2import dynamic from 'next/dynamic'; 3 4const ShakaPlayer = dynamic(() => import('shaka-player-react'), { ssr: false }); 5 6export default function Index() { 7 return ( 8 <div> 9 <ShakaPlayer autoPlay src="https://streams.com/example.mpd" /> 10 </div> 11 ); 12}
When using next/dynamic
with { ssr: false }
, we'll make sure the component is not interpreted by Next.js SSR. As of today, pre-rendering shaka-player's UI is technically not possible due to the fact that it is not written in React (but in plain Javascript). Although, shaka-player heavily relies on browser API's and serves no real purpose on a backend anyways.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 1/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
14 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More