Пример #1
0
        /// <summary>
        /// Start ad playback
        /// </summary>
        /// <param name="clip"></param>
        private void StartPlayback(AudioClip clip)
        {
            DisposeCurrentAudio();

            if (m_isBannerTextureLoaded)
            {
                VPlayerController.Instance.SetAdBannerActive(true);
            }

            if (m_adContainsBanner && m_isBannerTextureLoaded)
            {
                m_currentAd.DoEventTracking(VStrings.Ad_CreativeView);
            }

            m_currentAd.DoEventTracking(VStrings.Ad_Start);
            m_isAdStarted = true;

            m_audioSource.clip = clip;
            m_audioSource.Play();

            OnStarted();
        }
Пример #2
0
        /// <summary>
        /// Start ad playback
        /// </summary>
        /// <param name="clip"></param>
        private void StartPlayback(AudioClip clip)
        {
            DisposeCurrentAudio();

            if (m_isBannerTextureLoaded)
            {
                VPlayerController.Instance.SetAdBannerActive(true);
            }

            if (m_adContainsBanner && m_isBannerTextureLoaded)
            {
                m_currentAd.DoEventTracking(VStrings.Ad_CreativeView);
            }

            m_currentAd.DoEventTracking(VStrings.Ad_Start);

            if (m_currentAd != null && m_currentAd.GetImpressionUrls().Count > 0)
            {
                // Adswizz requires impression calls at start, other networks at completion
                if (m_currentAd.GetMediaUrl().Contains("adswizz"))
                {
                    foreach (var imprToCall in m_currentAd.GetImpressionUrls())
                    {
                        m_network.CallGet(imprToCall, null);
                    }
                }
            }
            else
            {
                OnError("Error calling impressions!");
            }

            m_isAdStarted = true;

            m_audioSource.clip = clip;
            m_audioSource.Play();

            OnStarted();
        }