Skip to content

A self-hosted media server and file management system

fix: media urls cant play if they include hashtag in filename Video with a # in the name will not play Fixes #194

aminnausine2cc2f8bfcaf
diff --git a/package-lock.json b/package-lock.json
index f0aeab86..bbebc9a5 100755
--- a/package-lock.json
+++ b/package-lock.json
@@ -4,7 +4,6 @@
"requires": true,
"packages": {
"": {
- "name": "mediaServer",
"dependencies": {
"@aminnausin/cedar-ui": "^0.0.9",
"@tanstack/vue-query": "^5.77.2",
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index ecee102e..0cee5cc3 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -1107,8 +1107,8 @@ defineExpose({
{ 'bg-black': !isAudio && !aspectRatio.isAspectVideo },
`${isShowingControls ? 'cursor-auto' : 'cursor-none'}`,
]"
- :src="stateVideo?.path ? `../${stateVideo?.path}` : ''"
- :poster="isAudio ? audioPoster : (handleStorageURL(stateVideo.metadata?.poster_url) ?? '')"
+ :src="stateVideo?.path ? encodeURIComponent(`../${stateVideo.path}`) : ''"
+ :poster="isAudio ? audioPoster : handleStorageURL(stateVideo.metadata?.poster_url)"
@play="isPaused = false"
@pause="isPaused = true"
@ended="onPlayerEnded"
diff --git a/resources/js/service/util.ts b/resources/js/service/util.ts
index bc28a436..6e9de2ce 100644
--- a/resources/js/service/util.ts
+++ b/resources/js/service/util.ts
@@ -180,8 +180,8 @@ export function within24Hrs(date: string): boolean {
* @param url The storage URL string.
* @returns The storage URL string with the correct protocol.
*/
-export function handleStorageURL(url: string | undefined): string | null {
- if (!url) return null;
+export function handleStorageURL(url: string | undefined): string {
+ if (!url) return '';
if (window.location.protocol === 'http:' && url.startsWith(`https://${window.location.host}`)) return url.replace('https:', 'http:');