Skip to content

Commit

Permalink
fix: Remove unused util
Browse files Browse the repository at this point in the history
  • Loading branch information
richiemcilroy committed Jun 6, 2024
1 parent 0efb074 commit 84c54a6
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions packages/utils/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,3 @@ export const isUserPro = async () => {

return false;
};

export async function getBlobDuration(blob: Blob) {
const tempVideoEl = document.createElement("video") as HTMLVideoElement;

const durationP = new Promise((resolve, reject) => {
tempVideoEl.addEventListener("loadedmetadata", () => {
if (tempVideoEl.duration === Infinity) {
tempVideoEl.currentTime = Number.MAX_SAFE_INTEGER;
tempVideoEl.ontimeupdate = () => {
tempVideoEl.ontimeupdate = null;
resolve(tempVideoEl.duration);
tempVideoEl.currentTime = 0;
};
} else resolve(tempVideoEl.duration);
});
tempVideoEl.onerror = () => resolve(0);
});

tempVideoEl.src = URL.createObjectURL(blob);

return durationP;
}

1 comment on commit 84c54a6

@vercel
Copy link

@vercel vercel bot commented on 84c54a6 Jun 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.