Add TapADN smart preload attribution

This commit is contained in:
2026-06-05 21:44:35 +08:00
parent c21bdec3fe
commit fd98a7f541
48 changed files with 9441 additions and 18 deletions

View File

@@ -70,10 +70,12 @@ public sealed class TapadnAwardVideoPlayer : ADPlayer, IDirichletRewardVideoAuto
}
curState = 1;
TapadnSmartLoadOrchestrator.OnLoadStarted(AD_Type.AwardVideo, AdScene);
_adNative.LoadRewardVideoAd(
TapadnAdRequestFactory.BuildRewarded(Key, TapadnAdController.CurrentOptions),
ad =>
{
TapadnSmartLoadOrchestrator.OnLoadResult(AD_Type.AwardVideo, AdScene, true);
_loadedAd?.Destroy();
_loadedAd = ad;
_loadedAd.Shown += OnManualShown;
@@ -86,6 +88,7 @@ public sealed class TapadnAwardVideoPlayer : ADPlayer, IDirichletRewardVideoAuto
},
error =>
{
TapadnSmartLoadOrchestrator.OnLoadResult(AD_Type.AwardVideo, AdScene, false);
curState = 0;
Debug.LogError($"[TapADN] Rewarded load failed. code={error.Code}, message={error.Message}");
});
@@ -127,12 +130,14 @@ public sealed class TapadnAwardVideoPlayer : ADPlayer, IDirichletRewardVideoAuto
_rewardCloseSettleHandler?.Kill();
_rewardCloseSettleHandler = null;
curState = 0;
TapadnSmartLoadOrchestrator.OnShowError(AD_Type.AwardVideo, AdScene);
Debug.LogError($"[TapADN] Rewarded show failed. code={error?.Code}, message={error?.Message}");
adListener.OnShowError();
}
public void OnAdShow()
{
TapadnSmartLoadOrchestrator.OnShowStart(AD_Type.AwardVideo, AdScene);
NotifyShowStarted();
}
@@ -168,6 +173,16 @@ public sealed class TapadnAwardVideoPlayer : ADPlayer, IDirichletRewardVideoAuto
{
}
public override void OnPlayRequestStarted()
{
TapadnSmartLoadOrchestrator.OnPlayRequestStarted(AD_Type.AwardVideo, AdScene, !UseAutoLoad() && IsReadly());
}
public override void EnterAdScenario(string scenario)
{
TapadnSmartLoadOrchestrator.OnEnterAdScenario(AD_Type.AwardVideo, scenario, Key);
}
private bool UseAutoLoad()
{
return TapadnAdController.CurrentOptions?.RewardedAutoLoad ?? true;
@@ -175,7 +190,7 @@ public sealed class TapadnAwardVideoPlayer : ADPlayer, IDirichletRewardVideoAuto
private void OnManualShown()
{
NotifyShowStarted();
OnAdShow();
}
private void OnManualClicked()