fix: Instagram audio rendering issues (#9957)

We are using `audio` component for rendering audio files in dashboard.

```
<audio v-else-if="isAudio" controls>
   <source :src="`${dataUrl}?t=${Date.now()}`" />
</audio>
```
We have added the timestamp for every audio URL for cache busting. For
Instagram, we are getting a signature URL. When we add any value and
access the URL, it results in an "Invalid signature. If I remove the
timestamp, the audio is rendering properly. This PR will change the
logic to construct the URL properly instead of direct string
manipulation.
This commit is contained in:
Muhsin Keloth
2024-08-14 13:24:00 +05:30
committed by GitHub
parent dd8abe975c
commit 06a362318c
3 changed files with 62 additions and 1 deletions
@@ -108,3 +108,12 @@ export const hasValidAvatarUrl = avatarUrl => {
return false;
}
};
export const timeStampAppendedURL = dataUrl => {
const url = new URL(dataUrl);
if (!url.searchParams.has('t')) {
url.searchParams.append('t', Date.now());
}
return url.toString();
};