Audio files play inside the portal without a download
When I deliver a mix or a mastered track through the portal, the client does not have to download it to hear it. The AttachmentList component checks every file's MIME type and renders a Play button next to any streamable audio format — MP3, MP4, AAC, OGG. Tap Play and the component fetches a signed URL from the API, sets it as the source of a native HTML audio element, and starts playback immediately. The audio element renders inline with full browser controls — play, pause, scrub, volume. When the track ends, the state resets and the button goes back to Play. Tap it again while it is playing and it stops. One toggle, one audio element, one signed URL per play. The same component handles every file type in the portal. Audio files get a Play button and a Download button. PDFs, images, and code archives get Download only. The distinction comes from two utility functions — isAudio checks whether the MIME type starts with audio or matches a known audio format, and isStreamableAudio narrows that to formats the browser can actually play. WAV files are audio but not streamable in every browser, so they get Download only. File sizes display in human-readable format — bytes, kilobytes, or megabytes — using a three-step formatter. The signed URL expires after twenty-four hours, but that does not matter because a fresh one is generated every time you press Play or Download. The client can listen to their mix, leave a comment in the thread underneath, and come back tomorrow for another listen with a new URL. One component handles stems, masters, accessibility reports, and software deliverables. The audio preview is just a feature of the same list.
Comments coming soon
Sign in with TikTok to leave a comment. Coming soon.