vime icon indicating copy to clipboard operation
vime copied to clipboard

Video source will never be requested under a rare condition

Open biaocy opened this issue 2 years ago • 1 comments

Hi there! I'm just start using vimejs today.

Ran into an minor issue which the player will never request the source when the entire html has no script tag. ( This is rather a rare case )

The bug triggering code was https://github.com/vime-js/vime/blob/1c5482eccd03be67a32a1589c023ce5d6194a9fd/packages/core/src/utils/network.ts#L53-L64

The last line will get a TypeError: Cannot read properties of undefined (reading 'parentNode') when there is no script tag in the entire html.

In this condition, we may need to check if there is a script tag in the html and insert the script elsewhere when it didn't find one.

I can create a PR if you want.

biaocy avatar Oct 02 '22 16:10 biaocy

Ran into this same issue again, and wasted another few hours.

biaocy avatar Nov 10 '22 12:11 biaocy