mirax-player
Advanced tools
Comparing version 1.0.0-beta.4 to 1.0.0-beta.5
{ | ||
"name": "mirax-player", | ||
"version": "1.0.0-beta.4", | ||
"version": "1.0.0-beta.5", | ||
"description": "A simple video player for react (beta release)", | ||
@@ -16,4 +16,4 @@ "main": "index.js", | ||
], | ||
"author": "DSilver", | ||
"author": "Demjhon Silver", | ||
"license": "MIT" | ||
} |
@@ -54,8 +54,6 @@ # Mirax Player | ||
const [isPlaying, setIsPlaying] = useState(false); | ||
useEffect(() => { | ||
const videoElement = attach('.whatever'); | ||
// you can declare any variable here starts with . (point known as class selector) | ||
// you can declare any variable here starts with . (known as class selector) | ||
// find className="whatever" src="clip.mp4" | ||
const options = { | ||
@@ -71,3 +69,2 @@ playPauseBtn: '.play-pause-btn', | ||
const videoPlayer = new Mirax(videoElement, options); | ||
// Listen for the "timeupdate" event to update time values | ||
@@ -77,6 +74,3 @@ videoElement.addEventListener('timeupdate', () => { | ||
}); | ||
return () => { | ||
// Clean up any resources if needed | ||
}; | ||
return () => {}; | ||
}, []); | ||
@@ -86,8 +80,4 @@ | ||
setIsPlaying(prevIsPlaying => { | ||
const video = attach('.whatever'); | ||
if (prevIsPlaying) { | ||
video.pause(); | ||
} else { | ||
video.play(); | ||
} | ||
const video = attach('.whatever'); // Can edit class selector | ||
if (prevIsPlaying) {video.pause();} else {video.play();} | ||
return !prevIsPlaying; | ||
@@ -99,19 +89,9 @@ }); | ||
<div className="video-player"> | ||
<video className="whatever" src="clip.mp4"></video> | ||
<div className="controls"> | ||
<div className="volume-icon"> | ||
<div className="speaker"></div> | ||
<div className="volume-icon"><div className="speaker"></div> | ||
</div> | ||
<button className="play-pause-btn" onClick={togglePlayPause}> | ||
{isPlaying ? 'Pause' : 'Play'} | ||
<button className="play-pause-btn" onClick={togglePlayPause}>{isPlaying ? 'Pause' : 'Play'} | ||
</button> | ||
<input | ||
type="range" | ||
className="volume-slider" | ||
min="0" | ||
max="1" | ||
step="0.01" | ||
defaultValue="1" | ||
/> | ||
<input type="range" className="volume-slider" min="0" max="1" step="0.01"defaultValue="1"/> | ||
<progress className="progress-bar" min="0" max="100" value="0"></progress> | ||
@@ -118,0 +98,0 @@ <div className="current-time"></div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12578
120