The EasyPlayer series project is an open player project developed by TSINGSEE Video. Users can call the interface or develop according to their own needs, which is highly practical and stable. Many users use EasyPlayer to develop or integrate by themselves.

A recent browser crash occurred while playing multiple FLV streams while using @easyDarwin/EasyPlayer. After analysis of the source code found that there is a timer program:

this.player.on("ended", () => { if (this.live) { this.isWaiting = true; this.timers = setInterval(this.myTimer, 1000); }});Copy the code

When the playback FLV is disconnected, the playback triggers the timer, which realizes the creation and destruction of the player. Because this step creates a large number of FLV flow requests in a short time, the player does not know when the FLV flow will return to normal and cannot destroy the scheduled task in time. Chrome allows a maximum of six TCP connections to the same domain name Host. Different browsers may establish different TCP connections, which causes the browser to crash.

If you want to achieve FLV disconnected reconnection, you can use the latest EasyPlayer and live channel interface to initialize and destroy the player. The reference code is as follows:

<EasyPlayer ref="easyPlayer" live :aspect="aspect" :onDemand="true" :autoplay="autoplay" v-loading="bLoading" : load. sync="bLoading" :videoUrl="oldVideoUrl" elemental-loading-text =" loading..." element-loading-background="#000" @message="$message" fluent stretch @ended="onPlayEnded" /> this.$refs.easyPlayer.initVideoJS(); this.$refs.easyPlayer.destroyVideoJS()Copy the code