Open talhaaslam01 opened 1 month ago
@ziafazal When the Scorm course is loaded in an iframe, it searches for the Scorm API in the global window variable which is initialized in initScorm function. If the Scorm xblock's page takes longer to load than the Scorm course in an iframe then, the Scorm course will look for the Scorm API in the window variable which is not available in the window variable at the moment and thus, resulting in an error, "Unable to acquire LMS API, content may not play properly and results may not be recorded".
Description
Load the Scorm iframe's 'src' attribute after initializing the Scorm API instead of directly in the 'scormxblock.html' file because it can lead to a race condition where the Scorm content may load faster and try to access the Scorm API before it is loaded, thus giving an error.