Here I want to modularize and re-use part of my code by converting it to a function, but in this case the automatic conversion in the editor is not supported, so I need to do it manually.
Features covered in this code-along style video include:
if (typeof(playerLoaded) === 'undefined') {var playerLoaded = false;}(function isVideojsDefined() {if (typeof(videojs) !== 'undefined') {videojs("mathworks-brightcove-player").on('loadedmetadata', function() {playerLoaded = true;});} else {setTimeout(isVideojsDefined, 10);}})();
Play the video in full screen mode for a better viewing experience.