AirenSoft / OvenPlayer

OvenPlayer is JavaScript-based LLHLS and WebRTC Player for OvenMediaEngine.
https://airensoft.com/ome.html
MIT License
515 stars 126 forks source link

player instance not really destroyed after player.remove() in Safari #361

Closed howard80920 closed 10 months ago

howard80920 commented 1 year ago

Safari version: 16.5(18615.2.9.11.4) OvenPlayer version: v0.10.29

I found that when executing remove() in Safari browser, only the destroy event is triggered and hlsDestroyed is not (but triggered in Chrome). As a result, after calling remove(), the network continues to request files.

Upon further investigation of the source code, I noticed the presence of window.open_hls. I attempted to manually execute hls.destroy(), but the printed result was undefined.

Is it possible to resolve this issue, or are there any temporary alternative solutions available? thanks a lot.

SangwonOh commented 1 year ago

Hi @howard80920. The hlsDestroyed event won't fire because safari doesn't use hlsjs. Please try getMediaElement().src= null and see if the chunks stop loading. I will also update OvenPlayer to be well removed from Safari. Thanks!

howard80920 commented 1 year ago

Hi @howard80920. The hlsDestroyed event won't fire because safari doesn't use hlsjs. Please try getMediaElement().src= null and see if the chunks stop loading. I will also update OvenPlayer to be well removed from Safari. Thanks!

I try getMediaElement().src= null before execute player.remove(), it's work. Thx!

SangwonOh commented 10 months ago

Close via https://github.com/AirenSoft/OvenPlayer/pull/388