In the past, this was exactly how it was done. Here's an article on the FBI doing it with an Apple webcam six years ago [0].
Should be noted that was after Apple went to the effort of making a hardware delay to try and force the LED to turn on first, but it was still worked around.
Should be noted that was after Apple went to the effort of making a hardware delay to try and force the LED to turn on first, but it was still worked around.
[0] https://www.smh.com.au/technology/researchers-activate-apple...