Rocket.Chat.ReactNative/app/lib/methods/getAudioUrl.ts

10 lines
408 B
TypeScript
Raw Normal View History

export const getAudioUrl = ({ audioUrl, baseUrl, cdnPrefix }: { audioUrl?: string; baseUrl: string; cdnPrefix: string }) => {
if (audioUrl && !audioUrl.startsWith('http')) {
audioUrl = `${cdnPrefix || baseUrl}${audioUrl}`;
}
return audioUrl;
};
export const getAudioUrlToCache = ({ token, userId, url }: { url?: string; userId: string; token: string }) =>
`${url}?rc_uid=${userId}&rc_token=${token}`;