// Mostra o video
    public override bool showVideo(VideoDelegate methodToCall)
    {
        if (!isVideoAvailable())
        {
            return(false);
        }

        try
        {
            if (Info.IsEditor())
            {
                return(false);
            }

#if UNITY_ANDROID
            callback = methodToCall;
            VungleAndroid.displayIncentivizedAdvert(false);
            return(true);
#elif UNITY_IPHONE
            callback = methodToCall;
            VungleBinding.playIncentivizedAd("user", false);
            return(true);
#else
            return(false);
#endif
        }
        catch
        {
            return(Error(API, ERROR_PLAY_VIDEO));
        }
    }
	// Mostra o video
	public override bool showVideo(VideoDelegate methodToCall)
	{
		if (!isVideoAvailable())
			return false;
		
		try
		{
			if (Info.IsEditor())
				return false;
				
#if UNITY_ANDROID
			callback = methodToCall;
			VungleAndroid.displayIncentivizedAdvert(false);
			return true;
#elif UNITY_IPHONE
			callback = methodToCall;
			VungleBinding.playIncentivizedAd("user", false);
			return true;
#else
			return false;
#endif
		}
		catch
		{
			return Error(API, ERROR_PLAY_VIDEO);
		}
	}
Beispiel #3
0
        public static bool Play(VideoDelegate callback)
        {
#if !UNITY_WEBPLAYER
            return(AdvertisementManager.showVideo(callback));
#else
            return(false);
#endif
        }
        private IEnumerator OnVideo(IntPtr pathPtr, VideoDelegate callback)
        {
            yield return(new WaitUntil(() => Marshal.ReadIntPtr(pathPtr) != IntPtr.Zero));

            MonoBehaviour.Destroy(callback); // We don't need this anymore
            pathPtr = Marshal.ReadIntPtr(pathPtr);
            var path = Marshal.PtrToStringAnsi(pathPtr);

            videoCallback(path);
        }
	// Mostra o video
	public override bool showVideo(VideoDelegate methodToCall)
	{
		try
		{
			if (Info.IsEditor() || Info.IsWeb() || !isVideoAvailable())
			{
				return false;
			}
			
			callback = methodToCall;
			
			return AdColony.ShowVideoAd();
		}
		catch
		{
			return Error(API, ERROR_PLAY_VIDEO);
		}
	}
Beispiel #6
0
    // Mostra o video
    public override bool showVideo(VideoDelegate methodToCall)
    {
        try
        {
            if (Info.IsEditor() || Info.IsWeb() || !isVideoAvailable())
            {
                return(false);
            }

            callback = methodToCall;

            return(AdColony.ShowVideoAd());
        }
        catch
        {
            return(Error(API, ERROR_PLAY_VIDEO));
        }
    }
Beispiel #7
0
        public void loadRewardedVideoForZoneId(string zoneIdiOS,
                                               string zoneIdAndroid,
                                               bool refresh)
        {
            if (refresh)
            {
                if (state != VideoState.New && state != VideoState.Loaded)
                {
                    return;
                }
            }
            else if (state != VideoState.New)
            {
                //Debug.Log("<AMRSDK> loadRewardedVideoForZoneId - state != VideoState.New returning");
                return;
            }

            state         = VideoState.Loading;
            androidZoneId = zoneIdAndroid;
            iosZoneId     = zoneIdiOS;
            isRefresh     = refresh;
            VideoDelegate videoDelegate = new VideoDelegate(this);

            if (Application.platform == RuntimePlatform.IPhonePlayer)
            {
                if (zoneIdiOS != null)
                {
                    rewardedVideo = new AMR.iOS.AMRRewardedVideo();
                    rewardedVideo.loadRewardedVideoForZoneId(zoneIdiOS, videoDelegate);
                }
            }
            else if (Application.platform == RuntimePlatform.Android)
            {
                if (zoneIdAndroid != null)
                {
                    if (rewardedVideo != null)
                    {
                        rewardedVideo.destroyRewardedVideo();
                    }
                    rewardedVideo = new AMR.Android.AMRRewardedVideo();
                    rewardedVideo.loadRewardedVideoForZoneId(zoneIdAndroid, videoDelegate);
                }
            }
        }
    // Mostra o video
    public static bool showVideo(VideoDelegate methodToCall)
    {
        if (!AdvertisementManager.isEnabled())
        {
            return(false);
        }

        if (Info.IsEditor() || AdvertisementManager.manager.video == null)
        {
            return(false);
        }

        foreach (AdvertisementBase ad in AdvertisementManager.manager.video)
        {
            if (ad.showVideo(methodToCall))
            {
                return(true);
            }
        }
        return(false);
    }
	public void OnVideoEnd()
	{
		Debug.Log("video was watched ADCOLONY");
		callback();
		callback = null;
	}
Beispiel #10
0
 // Mostra o video
 public virtual bool showVideo(VideoDelegate methodToCall)
 {
     return(false);
 }
 public void OnVideoEnd()
 {
     Debug.Log("video was watched VUNGLE");
     callback();
     callback = null;
 }
	// Mostra o video
	public virtual bool showVideo(VideoDelegate methodToCall)
	{
		return false;
	}
Beispiel #13
0
 public void OnVideoEnd()
 {
     Debug.Log("video was watched ADCOLONY");
     callback();
     callback = null;
 }
	public void OnVideoEnd()
	{
		Debug.Log("video was watched VUNGLE");
		callback();
		callback = null;		
	}
 private IEnumerator GetThumbnail (GCHandle thumbnailHandle, Action<Texture2D> callback, VideoDelegate callbackObject) {
     yield return new WaitUntil(() => Marshal.ReadIntPtr(thumbnailHandle.AddrOfPinnedObject()) != IntPtr.Zero);
     MonoBehaviour.Destroy(callbackObject); // We don't need this anymore
     var pixelBuffer = Marshal.ReadIntPtr(thumbnailHandle.AddrOfPinnedObject());
     var width = Marshal.ReadInt32(new IntPtr(thumbnailHandle.AddrOfPinnedObject().ToInt32() + sizeof(int)));
     var height = Marshal.ReadInt32(new IntPtr(thumbnailHandle.AddrOfPinnedObject().ToInt32() + 2 * sizeof(int)));
     var thumbnail = new Texture2D(width, height, TextureFormat.RGBA32, false);
     thumbnail.LoadRawTextureData(pixelBuffer, width * height * 4);
     thumbnail.Apply();
     SharingBridge.FreeThumbnail(thumbnailHandle.AddrOfPinnedObject());
     thumbnailHandle.Free();
     callback(thumbnail);
 }
Beispiel #16
0
		public static bool Play(VideoDelegate callback)
		{
#if !UNITY_WEBPLAYER
			return AdvertisementManager.showVideo(callback);
#else
			return false;
#endif
		}
	// Mostra o video
	public static bool showVideo(VideoDelegate methodToCall)
	{
		if (!AdvertisementManager.isEnabled())
			return false;
		
		if (Info.IsEditor() || AdvertisementManager.manager.video == null)
			return false;

		foreach (AdvertisementBase ad in AdvertisementManager.manager.video)
		{
			if (ad.showVideo(methodToCall))
			{
				return true;
			}
		}
		return false;
	}