Yes, you can pause a video inside an event handler in React, and it’s often the most appropriate place for direct user-triggered actions. You don’t need to restrict it to useEffect. Here’s a precise explanation:
Why Event Handlers Work
Direct Control: Event handlers (e.g., onClick, onKeyPress) are tied to user interactions, making them ideal for immediate actions like pausing a video.
Access to Ref: Using a ref to control the <video> element, you can call pause() directly in the handler.
No Dependency Issues: Unlike useEffect, event handlers don’t rely on state/effect synchronization, so you avoid unnecessary delays or re-renders.
Example: Pausing in Event Handler
import { useRef } from 'react';
const VideoPlayer = () => {
  const videoRef = useRef(null);
  const handlePause = () => {
    if (videoRef.current) {
      videoRef.current.pause(); // Pauses video directly
    }
  };
  return (
    <div>
      <video ref={videoRef} src="video.mp4" controls />
      <button onClick={handlePause}>Pause</button>
    </div>
  );
};