void adPod_RunCompleted(AdPod adPod, bool success) { adPod.RunCompleted -= adPod_RunCompleted; VastAdPod vastAdPod = adPod as VastAdPod; // unhook all the event handlers we added for the individual parts of the ad operation foreach (var vastAd in vastAdPod.Ads) { vastAd.RunCompleted -= vastAd_RunCompleted; foreach (var creativeSet in vastAd.CreativeSets) { creativeSet.RunStarting -= creativeSet_RunStarting; creativeSet.RunStarted -= creativeSet_RunStarted; creativeSet.RunCompleted -= creativeSet_RunCompleted; } } // clear out the current running AdSpot. This permits other ads to be handled. activeAdPod = null; // notify upstream if (!success) { vastAdPod.AdUnit.OnFail(); } vastAdPod.AdUnit.Deactivate(); OnHandleCompleted(new HandleCompletedEventArgs(vastAdPod.AdUnit.Source, success)); }
void adPod_RunCompleted(AdPod adPod, bool success) { adPod.RunCompleted -= adPod_RunCompleted; VastAdPod vastAdPod = adPod as VastAdPod; // unhook all the event handlers we added for the individual parts of the ad operation foreach (var vastAd in vastAdPod.Ads) { vastAd.RunCompleted -= vastAd_RunCompleted; foreach (var creativeSet in vastAd.CreativeSets) { creativeSet.RunStarting -= creativeSet_RunStarting; creativeSet.RunStarted -= creativeSet_RunStarted; creativeSet.RunCompleted -= creativeSet_RunCompleted; } } // clear out the current running AdSpot. This permits other ads to be handled. activeAdPod = null; // notify upstream if (!success) vastAdPod.AdUnit.OnFail(); vastAdPod.AdUnit.Deactivate(); OnHandleCompleted(new HandleCompletedEventArgs(vastAdPod.AdUnit.Source, success)); }
void adPod_ReleasePlayer(AdPod adPod) { adPod.ReleasePlayer -= adPod_ReleasePlayer; // release the play block (this will start the player again if a play operation was pending) ReleasePlayer(); }
void adPod_ReleasePlayer(AdPod adPod) { adPod.ReleasePlayer -= adPod_ReleasePlayer; // release the play block (this will start the player again if a play operation was pending) ReleasePlayer(); }