Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hasVideoContent() always returns false using UnifiedNativeAdMapper #496

Open
Neexol opened this issue Oct 9, 2023 · 4 comments
Open

hasVideoContent() always returns false using UnifiedNativeAdMapper #496

Neexol opened this issue Oct 9, 2023 · 4 comments
Assignees
Labels

Comments

@Neexol
Copy link

Neexol commented Oct 9, 2023

Hello,
If I use UnifiedNativeAdMapper when loading native ads and set the presence of video using setHasVideoContent() it has no effect.

Actual behavior:
You can reproduce this bug in your example:

  1. In the SampleUnifiedNativeAdMapper.java file, add setHasVideoContent(true) in the constructor;
  2. In the MainActivity.java file, in the onNativeAdLoaded() callback, nativeAd.getMediaContent().hasVideoContent() and nativeAd.getMediaContent().getVideoController().hasVideoContent() will return false, although they should return true.

Expected behavior:
hasVideoContent() returns true

Source:
Here is the source code with my edits that reproduces the bug based on this repository example (too big for direct load).

I have set the use of custom event. Also call setHasVideoContent(true) at L70 in SampleUnifiedNativeAdMapper.java and check it at L235 in MainActivity.java.

image image
@NVentimiglia
Copy link
Member

Hi @Neexol

Can you provide a minimal sample? I am having trouble understanding the issue.

I see SampleUnifiedNAtiveAdMapper.java, but there are multiple MainActivities

@Neexol
Copy link
Author

Neexol commented Nov 3, 2023

Hello @NVentimiglia, I have attached the source code to the issue, here is the link again. You can laod a native ad and view info in Logcat. https://drive.google.com/file/d/1sia6eJC81yHZNVHI5jUcUU_9MlNXr5Vx/view

@NVentimiglia
Copy link
Member

@Neexol

I replicated this on my end. Let me hand this off to the mediation team and I will get back to you.

@NVentimiglia NVentimiglia self-assigned this Nov 21, 2023
@NVentimiglia
Copy link
Member

@Neexol

Did some review, setHasVideoContent() does not override the MediaContent of the NativeAd. You can call setMediaContent() and include a MediaContent View Element to solve this problem.

That said, I will open an issue internally to get more information and possibly update this API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants