Uncaught TypeError: player.g is undefined with YouTube videos in Interactive Video 1.28

Hello everyone,

I am experiencing a critical issue when using YouTube videos inside an Interactive Video activity in Moodle. The interactive elements fail to load properly, and the browser console throws a JavaScript error regarding the YouTube API wrapper.

Here is the exact error stack from the console:

JavaScript Uncaught TypeError: can't access property "style", player.g is undefined create .../cachedassets/ab7ded9fc1a68cba58d794444d814d363a4c561b.js:894 onYouTubeIframeAPIReady .../cachedassets/ab7ded9fc1a68cba58d794444d814d363a4c561b.js:1308

Environment details:

  • Platform: Moodle 5.1

  • H5P Interactive Video version: 1.28.37

  • YouTube link format: Short URL ([https://youtu.be/](https://youtu.be/)...)

It seems to be a compatibility breakdown between the H5P video player wrapper and recent changes in YouTube's embedded API script (www-widgetapi.js). Has anyone encountered this or know how to patch it?

Thanks in advance for your support!