Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
use-video-player-hook
Advanced tools
Readme
custom react hook helps you to build custome video player
yarn add use-video-player-hook or npm i use-video-player-hook
const videoElement = useRef(null);
const {
playerState,
togglePlay,
handleOnTimeUpdate,
handleVideoProgress,
handleVideoSpeed,
toggleMute,
} = useVideoPlayer(videoElement);
return (
<div>
<div>
<video
src={src}
ref={videoElement}
onTimeUpdate={handleOnTimeUpdate}
/>
<div>
<button onClick={togglePlay}>
{!playerState.isPlaying ? (
<span>Play</span>
) : (
<span>Pause</span>
)}
</button>
<input
type="range"
min="0"
max="100"
value={playerState.progress}
onChange={(e) => handleVideoProgress(e)}
/>
<select
value={playerState.speed}
onChange={(e) => handleVideoSpeed(e)}
>
<option value="0.50">0.50x</option>
<option value="1">1x</option>
<option value="1.25">1.25x</option>
<option value="2">2x</option>
</select>
<button onClick={toggleMute}>
{!playerState.isMuted ? (
<span>Mute</span>
) : (
<span>Unmute</span>
)}
</button>
</div>
</div>
</div>
);
All you need is to pass videoElement ref as a parameter
const videoElement = useRef(null);
const {
playerState,
togglePlay,
handleOnTimeUpdate,
handleVideoProgress,
handleVideoSpeed,
toggleMute,
} = useVideoPlayer(videoElement);
package on npm https://npmjs.com/package/use-video-player-hook
Give a ⭐️ if this project helped you!
FAQs
custom react hook helps to create custom video player
The npm package use-video-player-hook receives a total of 22 weekly downloads. As such, use-video-player-hook popularity was classified as not popular.
We found that use-video-player-hook demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.