Android IMA ads have big playback delays on Fire TV

388 views
Skip to first unread message

Sergio Martinez

unread,
Oct 28, 2016, 1:45:07 PM10/28/16
to Interactive Media Ads SDK
Hi,

When I have multiple ads in an ad break, I'm experiencing long playback delays when transitioning from one ad to the other, from 5 to 12 seconds. I got this on the Fire TV and Fire TV stick.

I modified the mDefaultAdTagUrl in the VideoPlayerController.java file (BasicSample) to point to:

Because the Sample doesn't have support for the remote controller, i removed the play button onClickListener to start the playback immediately
// When Play is clicked, request ads and hide the button.
/*mPlayButton.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View view) {
        mVideoPlayerController.play();
        view.setVisibility(View.GONE);
    }
});*/
mVideoPlayerController.play();
mPlayButton.setVisibility(View.GONE);

It works fine on an Android TV.

Do you know why there are these delays on the Fire TV?

Thanks

Vu Chau (IMA SDK Team)

unread,
Oct 28, 2016, 2:54:43 PM10/28/16
to Interactive Media Ads SDK
Hi Sergio,

We don't have any known issues with such delays.  
  1. Are you sure it's not network-related?  
  2. Could you send us the complete ad tag?
  3. Do you have any log (network, IDE) with timestamps?

Vu Chau
IMA SDK Team

Sergio Martinez

unread,
Oct 28, 2016, 5:55:52 PM10/28/16
to Interactive Media Ads SDK
Hi Vu Chau,

It's not a network related issue. I run the sample on the Emulator(Android TV) and on the Fire TV at the same time and on the same network, and the response was better on the Emulator.

What do you mean with the complete Ad tag?
I just replaced the url above on the Basic sample app and I was able to reproduce it on the Fire TV.

//        mDefaultAdTagUrl = context.getString(R.string.ad_tag_url);
        mDefaultAdTagUrl = "http://pubads.g.doubleclick.net" +
               
"/gampad/ads?sz=640x480&iu=%2F15018773%2Feverything2" +
               
"&ciu_szs=300x250%2C468x60%2C728x90&impl=s" +
               
"&gdfp_req=1&env=vp&output=xml_vast2" +
               
"&unviewed_position_start=1" +
               
"&url=dummy" +
               
"&correlator=[timestamp]" +
               
"&cmsid=133" +
               
"&vid=10XWSh7W4so" +
               
"&ad_rule=1";


The log for a pre-roll taken from the Basic Sample app is attached.
Thanks
basic-sample-firetv-log.txt

Vu Chau (IMA SDK Team)

unread,
Oct 28, 2016, 10:05:17 PM10/28/16
to Interactive Media Ads SDK
Hi Sergio,

Thanks for sending over the additional details. I took a look and would still need further information to complete my understanding.

I am going to ask you to check the IDE's log to see if IMA throws any ad error events during those playback delays on Fire TV. From your log, I do see an "Event: LOG" fired, which suggests there was an error but it wasn't fatal enough for IMA to stop ad playback altogether. You can call AdEvent.getAdData()[‘errorMessage’] to expose the inner error wrapped inside that LOG event, if needed. If the next ad in the pod is expected to play but doesn't (which might explain the latency in trying to fetch it and waiting for it to play), it might be good to watch for any timeout errors as well.

If you check your network traffic, looking at the timestamps of the ad requests for the midrolls can also be a good start. Is the implementation on Fire TV simply not making the ad request until 5-12 seconds after the current ad completes? Or does it make a timely request but that the actual media isn't pinged until later?

Another thing is that the tag is returning a <Playlist>, which is legacy. Change the &output parameter in your tag to "&output=vmap" so that the server returns a VMAP tag, and test with it.

Let me know your findings,

Vu Chau
IMA SDK Team

Sergio Martinez

unread,
Oct 31, 2016, 2:14:13 PM10/31/16
to Interactive Media Ads SDK
Hi Vu Chau,

I changed the output to vmap as you said but I din't see a difference.
There's not an easy way to set the proxy on the Fire TV (as it's not supported), so I'm not able to see the requests and their times at the moment.

I added the log for adEvent.getAdData and got this:
AdData: {type=adLoadError, errorCode=1009, errorMessage=The response does not contain any valid ads.}
but the thing is that I got that error on a Nexus 9 and the Nexus plays fine.

I got similar errors on both devices (Nexus and Fire TV) and only the Fire TV showed the delay problems.
Attached you can find the logs for both devices without any filter, playing the same IMA Basic sample, same Ad tag url and in the same network.

Note that all ads play on the Fire TV, only with the huge delay.

Thanks
Sergio
ima-basicsample-nexus9-nonfiltered.txt
ima-basicsample-firetv-nonfiltered.txt

Vu Chau (IMA SDK Team)

unread,
Oct 31, 2016, 4:50:24 PM10/31/16
to Interactive Media Ads SDK
Hi Sergio,

Thanks for getting back with the test results. 

We currently don't have a dedicated SDK for Android TVs, so it's hard to say what the problem might be if you are tweaking the regular SDK for Android to make it work on TVs.  

I looked at your log from the Fire TV, and the latency is actually occurring between LOADED and STARTED within the same ad, as opposed to between the last ad's COMPLETED and the next ad's LOADED (i.e. between any two ads).  What that means is that the ad's VAST response is received, but it's not starting to play until some time later.  This could be a quirky behavior with the Fire TV itself, where its hardware might just be taking a little longer to decode and render the ad.  This doesn't happen on the Nexus, which shows IMA is working well as far as the ad's lifecycle is concerned.

What you could do to improve this experience is to try with another video player as opposed to the one we provided in the sample (MediaPlayer).  Some video players might be more compatible and efficient with the Fire TV.

Vu Chau
IMA SDK Team

Reply all
Reply to author
Forward
0 new messages