public static bool IsVideoAvailableByZoneKey(string zoneKey) { bool isZoneAvailable = false; if (ContainsZoneKey(zoneKey)) { ADCVideoZone videoZone = ADCAdManager.GetVideoZoneObjectByKey(zoneKey); if (videoZone != null) { if (videoZone.zoneType == ADCVideoZoneType.Interstitial) { if (AdColony.IsVideoAvailable(videoZone.zoneId)) { isZoneAvailable = true; } } else if (videoZone.zoneType == ADCVideoZoneType.V4VC) { if (AdColony.IsV4VCAvailable(videoZone.zoneId)) { isZoneAvailable = true; } } else { //Check nothing, video zone type isn't correct } } } return(isZoneAvailable); }
public static void ShowVideoAdByZoneKey(string zoneIdKey, bool offerV4VCBeforePlay = false, bool showPopUpAfter = false) { ADCVideoZone videoZone = GetVideoZoneObjectByKey(zoneIdKey); string zoneId = GetZoneIdByKey(zoneIdKey); if (IsVideoAvailableByZoneKey(zoneIdKey)) { if (videoZone.zoneType == ADCVideoZoneType.Interstitial) { AdColony.ShowVideoAd(zoneId); } else if (videoZone.zoneType == ADCVideoZoneType.V4VC) { if (offerV4VCBeforePlay) { AdColony.OfferV4VC(showPopUpAfter, zoneId); } else { AdColony.ShowV4VC(showPopUpAfter, zoneId); } } else { //Check nothing, video zone type isn't correct Debug.Log("An incorrect video zone type was requested to play. Please resolve this issue."); } Debug.Log("The zone '" + zoneId + "' was requested to play."); } else { Debug.Log("The zone '" + zoneId + "' was requested to play, but it is NOT ready to play yet."); } }