vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.74k stars 153 forks source link

TypeError: Cannot read properties of undefined (reading 'trim') #379

Open nick4414 opened 6 months ago

nick4414 commented 6 months ago

Hi, since the 10.01.2024 all our users get the bug:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'trim') at Object.buildAbsoluteURL (url-toolkit.js:21:33) at e.loadSource (hls.ts:401:39) at HLS. (video-player~user-account.js?id=fd885bb62350cccedb83:82493:65) at Generator.next () at video-player~user-account.js?id=fd885bb62350cccedb83:82360:67 at new Promise () at push../node_modules/@vime/core/dist/custom-elements/index.js.__awaiter$f (video-player~user-account.js?id=fd885bb62350cccedb83:82346:10) at HLS.onSrcChange (video-player~user-account.js?id=fd885bb62350cccedb83:82490:12) at t. (video-player~user-account.js?id=fd885bb62350cccedb83:82413:16) at o.emit (index.js:203:33)

when using the HLS Player. I didn't change the code for months. There was a Chrome, Edge, Safari Update on the 10.01.24 and that's when the errors started. Could it be a problem on your end ?

EDIT: Your HLS demo has the same issue: https://vimejs.com/demo

lucasmgsilva commented 6 months ago

Same

ashveen commented 6 months ago

Looks related to hls.js v1.5.x released 2 days ago. https://github.com/video-dev/hls.js/releases/tag/v1.5.0

I added version="1.4.14" as workaround in the Hls props to mitigate this issue. Been going through the hls.js release notes and so far have not found any clue why it is breaking.

debug logs:

[log] > Debug logs enabled for "Hls instance" in hls.js version 1.5.0
hls.ts:380 [log] > attachMedia
buffer-controller.ts:192 [log] > [buffer-controller] created media source: MediaSource
index.js:1273 [error] > Media element src was set while attaching MediaSource (blob:http://localhost:3001/b3797da8-daaf-462d-8b61-f0ef5340d581 > undefined)
buffer-controller.ts:979 [log] > [buffer-controller] Media source opened
hls.ts:442 [log] > stopLoad
BBR-Agency commented 6 months ago

Hi, since the 10.01.2024 all our users get the bug:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'trim') at Object.buildAbsoluteURL (url-toolkit.js:21:33) at e.loadSource (hls.ts:401:39) at HLS. (video-player~user-account.js?id=fd885bb62350cccedb83:82493:65) at Generator.next () at video-player~user-account.js?id=fd885bb62350cccedb83:82360:67 at new Promise () at push../node_modules/@vime/core/dist/custom-elements/index.js.__awaiter$f (video-player~user-account.js?id=fd885bb62350cccedb83:82346:10) at HLS.onSrcChange (video-player~user-account.js?id=fd885bb62350cccedb83:82490:12) at t. (video-player~user-account.js?id=fd885bb62350cccedb83:82413:16) at o.emit (index.js:203:33)

when using the HLS Player. I didn't change the code for months. There was a Chrome, Edge, Safari Update on the 10.01.24 and that's when the errors started. Could it be a problem on your end ?

EDIT: Your HLS demo has the same issue: https://vimejs.com/demo

did you by any chance get a workaround on this? especially on hls videos?

nick4414 commented 6 months ago

A workaround is (like @ashveen mentioned):

<template>
  <Player controls>
    <Hls :config="hlsConfig" version="1.4.14" poster="/media/poster.png">
      <source data-src="/media/index.m3u8" type="application/x-mpegURL" />
    </Hls>
    <!-- ... -->
  </Player>
</template>

Just use the older version 1.4.14 of the HLS package, not the latest one.

sheerazabbas commented 6 months ago

Thanks for the quick workaround @ashveen

Tayyab-Abbas commented 6 months ago

Hi, since the 10.01.2024 all our users get the bug:

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'trim') at Object.buildAbsoluteURL (url-toolkit.js:21:33) at e.loadSource (hls.ts:401:39) at HLS. (video-player~user-account.js?id=fd885bb62350cccedb83:82493:65) at Generator.next () at video-player~user-account.js?id=fd885bb62350cccedb83:82360:67 at new Promise () at push../node_modules/@vime/core/dist/custom-elements/index.js.__awaiter$f (video-player~user-account.js?id=fd885bb62350cccedb83:82346:10) at HLS.onSrcChange (video-player~user-account.js?id=fd885bb62350cccedb83:82490:12) at t. (video-player~user-account.js?id=fd885bb62350cccedb83:82413:16) at o.emit (index.js:203:33)

when using the HLS Player. I didn't change the code for months. There was a Chrome, Edge, Safari Update on the 10.01.24 and that's when the errors started. Could it be a problem on your end ?

EDIT: Your HLS demo has the same issue: https://vimejs.com/demo

Yeah, that seems to be a bad implementation in @vime/vue for using dependencies with cdn @mihar-22, I know this is not actually your package fault but in case if you use all other dependencies with their cdn. they will get updated from time to time even with bugs that what users currently face even they don't have updated their package. As you guys are going toward #Vidtack package. Please keep in mind that you should use dependencies as module part of your package not as cdn So, your package could be stable till every update you launch. Thanks

sven-ra commented 1 month ago

Downgrading HLS to 1.4.14 does not fix the issue on Safari. On desktop Safari half the times it works other half not. On iOS Safari I get the same error every time.