var player; function resizeVideoJS() { width = document.body.clientWidth; height = document.body.clientHeight; player.width(width).height(height); if (typeof (player.ima.adsManager) !== 'undefined') { player.ima.onFullscreenChange_(); } } function loadVideoJS() { var options = { id: 'cm_mediaplayer', adTagUrl: '', adTagUrlOverlay: '', locale: 'tr', debug: true }; player = videojs('cm_mediaplayer', { language: "tr", autoplay: false }); var clickedOnce = false; player.on('click', function() { if (!clickedOnce) { clickedOnce = true; player.play(); } }); player.ready(function() { //resizeVideoJS(); //window.onresize = resizeVideoJS; if (options.adTagUrl) { player.ima(options); //player.ima.setPostrollBanner(0); //player.ima.setOverlayBanner(0); player.ima.initializeAdDisplayContainer(); player.ima.requestAds(); } clickedOnce = true; player.play(); }); }