function getPlayableAds(ads, maxDuration, maxQuantity, forceStandAloneAd) {
        const { adPod } = ads
            .filter(ad => Boolean(ad.sequence))
            .sort((adX, adY) => adX.sequence - adY.sequence)
            .reduce((playableAds, ad) => {
                if (playableAds.adPod.length < maxQuantity && (playableAds.totalDuration + ad.duration) <= maxDuration) {
                    playableAds.adPod.push(ad);
                }

                return playableAds;
            }, { adPod: [], totalDuration: 0 });
        const adBuffet = ads.filter(ad => !Boolean(ad.sequence) && ad.duration < maxDuration);

        const isValidAdPodFormats = adPod.map(ad => ad.adType).slice(0, -1).every(adType => adType === 'linear');

        if (adPod.length > 0 && !forceStandAloneAd && isValidAdPodFormats) {
            playerInstance.debugMessage('Playing valid adPod', adPod);
            return adPod;
        } else {
            playerInstance.debugMessage('Trying to play single ad, adBuffet:', adBuffet);
            return adBuffet.length > 0 ? [adBuffet[0]] : [];
        }
    }
Handles selection of ad pod or standalone ad to be played

@param {Array<Ad>} ads
@param {number} maxDuration
@param {number} maxQuantity
@param {boolean} forceStandAloneAd