Search Unity

Advertising often get stuck, buffing...

Discussion in 'Unity Ads' started by taecg, Feb 8, 2015.

  1. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    Hi, we are a team from China, very much like you this product.

    Because our country network stuck problems often when playing the video, have been prompted in loading...

    There is no way to judge the whole video is fully cache and then play?

    Also because our country network cost problem, hope to be able to specify whether only in the WiFi environment before caching download advertising in the background.

    嗨,我们是来自中国的团队,非常喜欢你们的这个产品。
    由于我们国家网络的问题导致经常播放视频时卡住,一直提示在加载中。。。
    有没有办法判断整个视频是否已经完全缓存并再播放呢?
    另外也是因为我们国家网络费用问题,希望可以在后台能指定是否只在wifi环境下才进行缓存下载广告。
     
  2. unity-nikkolai

    unity-nikkolai

    Unity Technologies

    Joined:
    Sep 18, 2014
    Posts:
    541
    Unity Ads does not currently have a way of checking for connection type before showing ads, but you could check to see that internetReachability is not ReachableViaCarrierDataNetwork before attempting to show ads:

    Code (CSharp):
    1. public void ShowAd (string zoneID = null)
    2. {
    3.     if (Application.internetReachability == NetworkReachability.ReachableViaCarrierDataNetwork)
    4.     {
    5.         Debug.LogWarning("Unable to show ads while device is using a carrier data network.");
    6.     }
    7.     else
    8.     {
    9.         if (string.IsNullOrEmpty(zoneID)) zoneID = null;
    10.    
    11.         if (Advertisement.isReady(zoneID))
    12.         {
    13.             Advertisement.Show(zoneID);
    14.         }
    15.         else Debug.LogWarning("Unable to show ads: default zone is not ready.");
    16.     }
    17. }
     
    Salazar likes this.
  3. taecg

    taecg

    Joined:
    Jun 14, 2014
    Posts:
    26
    thanks!!