Clipping/trimming

Need help in understanding the function for clipping / trimming,
we have this clipping functionality where the user specify the start time and end time to save a part of the video, then, they can play this trimmed video whenever they want.

I tried using the getCurrentTime() function but encountered some errors , can we get some assistance on this topic