diff --git a/src/utils/string.ts b/src/utils/string.ts index ca19bef..a1c0225 100644 --- a/src/utils/string.ts +++ b/src/utils/string.ts @@ -51,9 +51,9 @@ export const removeHttpS = (url: string): string => { }; export const encodeVideoUrlPath = (input: string): string => { - return input.replace(/^\/+/, '').replace(/\/+$/, '').replace(/\//g, "-"); + return encodeURIComponent(input.replace(/^\/+/, '')) }; export const decodeVideoUrlPath = (input: string): string => { - return `/${input.replace(/^\-+/, '').replace(/\-+$/, '').replace(/\-/g, "/")}`; + return `/${decodeURIComponent(input)}`; }; \ No newline at end of file