Safari screen capture pause event handling

Hi, I'm working on screen recording in Safari. After permission prompted and recording started I see red icon with "screens" next to search bar and the same icon but with white color in tray. After clicking on such icon I can see "pause" option. Is it possible to catch event from that action or disable such option at all?

PS. Different icon appears in case when I try to record from camera or just from microphone but with same "pause" option.

Screenshots are attached

Thanks