Conclusion
Without a frame-src directive in the CSP, default-src 'self' blocks the iframe embed itself, so no YouTube video plays at all — even with script-src allowing the YouTube domain. And if script-src doesn't allow that domain either, the IFrame Player API script can't load, so window.YT — which the player depends on — never gets defined. That means playback isn't the only thing that breaks: the watch-time logging that monitors playback state and reports it also stops, silently. The fix was adding the exact domains YouTube actually uses to three separate directives: script-src , img-src , and frame-src .
Symptom
The CSP for a learning-video platform was defined in one place, securityHeaders in next.config.ts . Before the fix it looked like this:
const securityHeaders = [ // ...…