MSE unbind leaks its object URL before sourceopen
您使用的西瓜播放器版本是多少? What version of xgplayer are you using?
xgplayer-streaming-shared 3.0.26, current main at 2c4e5f6c44af7a536b3b8c39c5f4f7567b08078e.
您使用的操作系统和浏览器分别是? What OS and browser are you using?
The lifecycle problem is browser-independent in the shared MSE wrapper. It is reproducible with the repository's jsdom/Jest MediaSource mocks on Windows 11 and Node.js 24.14.1.
如何复现问题? How to reproduce the problem?
- Construct MSE and call bindMedia(video).
- Confirm URL.createObjectURL is called for the MediaSource.
- Call unbindMedia() before the MediaSource dispatches sourceopen.
- Inspect URL.revokeObjectURL and the old MediaSource's sourceopen listener.
bindMedia() currently revokes the object URL only inside its sourceopen callback. unbindMedia() clears this._url without revoking it and does not remove that pending callback.
您期望的播放器正常行为是? What did you expect to happen?
Unbinding before sourceopen should remove the pending listener and revoke the owned object URL before discarding it.
实际播放器的表现是? What actually happened?
The object URL is not revoked and the old MediaSource retains the callback. Repeated bind/unbind cycles before sourceopen can retain MediaSource resources; a late callback also closes over the previous media element and can interact with a later open-promise state.
可填写您所在的公司和相关产品业务,方便我们提供更好的技术支持 You can write your company and product which uses xgplayer, for helping us provide better technical support.
Independent maintenance audit; no company/product context.
Source: bytedance/xgplayer