How to discontinue video using Mediasource(MSE)?

I have 2 different videos or video 1 and video 2, using the mse as a lamp or buffer properly so that the video 2 is played, they have mpegts-2, I am using the muxjs to make the conversation, so everything works fine using the appendbuffer, to make it clearer, you will create this array of two segments of video1: let video_1_segs = ['path1/1.ts','path1/2.ts','path1/3.ts'];
and here’s video 2:
let video_2_segs = ['path2/1.ts','path2/2.ts','path2/3.ts'];
now how to make a safe sequence when or or segment 3 for played completely? Quaisquer duvida or more parts of the code is only talk