jQuery(document).ready(function($){
    $(document).on('mfpOpen', function(){
        let attempts = 0;
        const resizeVideo = setInterval(function(){
            $('.portfolio-wrap .mfp-content iframe, .portfolio-wrap .mfp-content video').css({
                width: '900px',
                height: '506px'
            });
            attempts++;
            if(attempts > 10) clearInterval(resizeVideo);
        }, 200);
    });
});