Skip to content

Commit

Permalink
Merge pull request #5 from esdete2/4-fix-audio-loaded-event
Browse files Browse the repository at this point in the history
fix: use loadedmetadata to determine if audio can be played
  • Loading branch information
esdete2 authored Jun 1, 2024
2 parents b89f085 + adeb165 commit 485e4e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-mirt",
"version": "1.3.1",
"version": "0.0.0-semantically-released",
"author": "Philip Schmidt <[email protected]>",
"description": "An iOS inspired audio trimmer component for React",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion src/Mirt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const Mirt = ({
if (!audio) return;

if (audio?.src) {
audio.addEventListener('canplaythrough', handleLoadedAudio);
audio.addEventListener('loadedmetadata', handleLoadedAudio);
audio.load();
}
}, [audio]);
Expand Down

0 comments on commit 485e4e3

Please sign in to comment.