Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aplayer-react

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aplayer-react - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2-alpha.1

39

dist/index.js

@@ -361,2 +361,5 @@ "use strict";

const audio = audioElementRef.current = document.createElement("audio");
if (typeof options?.src !== "undefined") {
audio.src = options.src;
}
if (typeof options?.autoPlay !== "undefined") {

@@ -405,5 +408,7 @@ audio.autoplay = options.autoPlay;

if (audio) {
audio.pause();
audio.currentTime = 0;
audio.src = src;
if (audio.src !== src) {
audio.pause();
audio.currentTime = 0;
audio.src = src;
}
try {

@@ -417,13 +422,16 @@ await audioElementRef.current?.play();

);
const togglePlay = (0, import_react3.useCallback)(() => {
const audio = audioElementRef.current;
if (!audio) {
return;
}
if (audio.paused) {
audio.play();
} else {
audio.pause();
}
}, [audioElementRef]);
const togglePlay = (0, import_react3.useCallback)(
(src) => {
const audio = audioElementRef.current;
if (!audio) {
return;
}
if (audio.paused) {
playAudio(src);
} else {
audio.pause();
}
},
[audioElementRef, playAudio]
);
const seek = (0, import_react3.useCallback)(

@@ -802,2 +810,3 @@ (second) => {

const audioControl = useAudioControl({
src: playlist.currentSong.url,
initialVolume: volume,

@@ -858,3 +867,3 @@ autoPlay,

),
onClick: () => audioControl.togglePlay(),
onClick: () => audioControl.togglePlay(playlist.currentSong.url),
children: audioControl.isPlaying ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SvgPause, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(SvgPlay, {})

@@ -861,0 +870,0 @@ }

{
"name": "aplayer-react",
"version": "1.0.1",
"version": "1.0.2-alpha.1",
"description": "The missing APlayer for React applications",

@@ -5,0 +5,0 @@ "keywords": [

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc