Exemplo n.º 1
0
    public void ShowVideo(AdadVideoType type, Action onComplete, Action <int, string> onError = null)
    {
        OnVideoComplete = onComplete;

        if (onError != null)
        {
            OnVideoError = onError;
        }

        switch (type)
        {
        case AdadVideoType.closeable:
            ShowClosableVideoAd();
            break;

        case AdadVideoType.rewarded:
            ShowRewardVideoAd();
            break;

        case AdadVideoType.general:
            ShowGeneralVideoAd();
            break;

        default:
            break;
        }
    }
Exemplo n.º 2
0
    public void PrepareVideo(AdadVideoType type, Action onLoad, Action <int, string> onError = null)
    {
        OnVideoLoaded = onLoad;

        if (onError != null)
        {
            OnVideoError = onError;
        }

        switch (type)
        {
        case AdadVideoType.closeable:
            if (IsClosableVideoAdReady())
            {
                OnVideoLoaded();
                OnVideoLoaded = null;
                return;
            }
            PrepareClosableVideoAd();
            break;

        case AdadVideoType.rewarded:
            if (IsRewardVideoAdReady())
            {
                OnVideoLoaded();
                OnVideoLoaded = null;
                return;
            }
            PrepareRewardVideoAd();
            break;

        case AdadVideoType.general:
            if (IsGeneralVideoAdReady())
            {
                OnVideoLoaded();
                OnVideoLoaded = null;
                return;
            }
            PrepareGeneralVideoAd();
            break;

        default:
            break;
        }
    }