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

Ad Load Error #3180

Closed
chadvonburgess opened this issue Aug 16, 2017 · 16 comments
Closed

Ad Load Error #3180

chadvonburgess opened this issue Aug 16, 2017 · 16 comments
Assignees
Labels

Comments

@chadvonburgess
Copy link

chadvonburgess commented Aug 16, 2017

Issue description

so I am trying to get the new version of exoplayer's demo to load and correctly play a preroll ad and a hls stream from an m3u8 file. The problem is that I get a vast timeout error such as this :
Caused by: AdError [errorType: PLAY, errorCode: AdErrorCode [name: VAST_MEDIA_LOAD_TIMEOUT, number: 402], message: VAST media file loading reached a timeout of 8 seconds.]

After I recieve this error it starts to play the underlying content

I noticed that in this link https://support.google.com/dfp_premium/answer/4442429?hl=en
under 402 we see another link for this:
"When the loadVideoTimeout setting in the IMA SDK is set unreasonably low. The default is 8 seconds."

However, I don't see a way to set this in the RenderSettings in the android version. I would love any feedback you guys could provide!

Reproduction steps

replace the first IMA Sample ad tags tuple values with the ones in the email; "uri" and "ad_tag_url".

Link to test content

links provided in email

Version of ExoPlayer being used

latest 2.5..

Device(s) and version(s) of Android being used

Samsung s7 edge 7.0
Samsung s6 7.0

A full bug report captured from the device

emailed in

@andrewlewis andrewlewis self-assigned this Aug 17, 2017
@andrewlewis
Copy link
Collaborator

8 seconds already seems like a long wait before playback can start. Can you somehow reduce the latency of loading the ad tag?

If you don't want the content to play in this case, you can handle the ad loading error via ImaAdsMediaSource.onAdLoadError and stop the player or show a message.

@ojw28 ojw28 added the question label Aug 17, 2017
@chadvonburgess
Copy link
Author

that just bubbles up the exception, I want the player to ignore this error and continue playing the ad until it finishes and then play the underlying content, right now it just calls this error and finishes the ad and plays the content, if I switch out the content stream for another one it finishes correctly. I am kind of looking for a way to ignore this 8 second time out

@andrewlewis
Copy link
Collaborator

Not sure I understand "if I switch out the content stream for another one it finishes correctly" -- please could you clarify this?

For the Android IMA SDK it looks like the default timeout is five seconds and can be overridden via AdsRequest.setVastLoadTimeout. I will mark this as an enhancement to allow apps to customize the value.

@chadvonburgess
Copy link
Author

chadvonburgess commented Aug 17, 2017

So if I take the "uri" field for a different content uri such as https://storage.googleapis.com/exoplayer-test-media-1/mkv/android-screens-lavf-56.36.100-aac-avc-main-1280x720.mkv , it works. let me check the vastLoadTimeout, hard to find this attribute in terms of documentation let me find out if setting this manually works

@chadvonburgess
Copy link
Author

chadvonburgess commented Aug 17, 2017

adding request.setVastLoadTimeout(35000); directly in the requestAds() method in ImaAdsLoader didn't seem to help the situation. Is there a different place one would set this?

@andrewlewis
Copy link
Collaborator

Actually, this error is caused by timing out loading the media URL in the VAST response, not loading the VAST response itself, so I think setVastLoadTimeout won't help. It appears that there is no way to customize the media loading timeout on Android (though it is apparently possible with the HTML5 SDK).

I tried playing the URIs provided via email several times and didn't see this error. The ad plays then the content plays reliably. Do you see this error in the ExoPlayer demo app if you modify the first ad sample to use the provided URIs?

I am still a bit confused about the description of the problem. Does the ad start playing, then the error occurs while it is playing? Also, eight seconds should be plenty of time to load the ad media, and I'm not convinced you'd want users to wait longer than that. It might help diagnosing what's going on if you could email logcat captured while reproducing the issue with ImaAdsLoader.DEBUG set to true. Thanks!

@chadvonburgess
Copy link
Author

I do see this error when I modify the ExoPlayer's first ad sample. it appears that in the method onAdEvent() gets called and we get a resume content requested which causes the ad to stop playing, even though it has clearly not reached the end of playing. We want the ad to play all the way through and then move to play the content I will send more updated logs

@chadvonburgess
Copy link
Author

chadvonburgess commented Aug 31, 2017

I have sent additional information Via email to dev.exoplay@gmail.com. If you use the information provided the error is repeatable directly from the demo

@chadvonburgess
Copy link
Author

Is there any additional information than can be delivered on your side of things? or do we need to provide more information?

@chadvonburgess
Copy link
Author

Also talked to the IMA people over here at their boards : https://groups.google.com/forum/#!topic/ima-sdk/3FFR55HyN6g

they are suggesting that it might be something wrong with the implementation. Also I tested these tags in their player implementation and it would appear to work there.

@ojw28 ojw28 added bug and removed need more info labels Sep 6, 2017
@ojw28
Copy link
Contributor

ojw28 commented Sep 6, 2017

This is a bug in ExoPlayer, where we incorrectly apply a position offset related to the content to the position during the ad playback. This causes us to report incorrect ad playback positions to the IMA library, which causes the IMA library to think that the ad isn't playing, which triggers the error.

The issue only occurs for HLS content that uses PROGRAM-DATE-TIME tags, since it's these that make the content position offset non-zero. This is why you see the problem for the specific content you link to, but not other HLS streams (or regular media streams).

We'll merge a fix into dev-v2 shortly, and provide a release next week including the fix. Thanks for reporting!

ojw28 added a commit that referenced this issue Sep 6, 2017
…set.

Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: #3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
@ojw28
Copy link
Contributor

ojw28 commented Sep 6, 2017

Should be fixed by the change ref'd above.

@ojw28 ojw28 closed this as completed Sep 6, 2017
ojw28 added a commit that referenced this issue Sep 6, 2017
…set.

Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: #3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
@hooked82
Copy link

hooked82 commented Sep 8, 2017

@ojw28 Is there a planned release date so that we can coordinate our internal release that will include this fix?

ojw28 added a commit that referenced this issue Sep 9, 2017
…set.

Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: #3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032
@ojw28
Copy link
Contributor

ojw28 commented Sep 9, 2017

We'll be pushing a bugfix release (2.5.2) early next week, so keep an eye out for that. Thanks!

hishamMuneer added a commit to hishamMuneer/ExoPlayer that referenced this issue Sep 14, 2017
* Minimal change to expose segment indices in DefaultDashChunkSource

Issue: google#3037

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164614478

* Clean up terminology for MediaSession extension

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164705750

* Fix minor Javadoc error

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164706078

* Document usage of the RTMP extension

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164706135

* set mediaSession flags properly and keep queue in sync when timeline changes

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164774783

* Support multiple video/text/metadata outputs

We've seen more than one issue filed where a developer has
registered a video listener and been confused by the fact
their SimpleExoPlayerView no longer works properly. There
are also valid use cases for having multiple metadata/text
outputs.

Issue: google#2933
Issue: google#2800
Issue: google#2286
Issue: google#2240

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164839882

* Fix maskingX variables when timeline becomes empty

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164840037

* Restrict usage of secure DummySurface for all Samsung devices.

* Support H262 video in MP4

* Fix possible subrip timing line NPE

* Support crop mode for AspectRatioFrameLayout

* Add flag to CachedContentIndex to disable encryption.  This allows the encryption feature
to be disabled gracefully: encrypted index files may be read, but plaintext will be written.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165196508

* Disable secure dummy surface on all Samsung N devices

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291627

* Update instructions to include Google Maven repository

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165291982

* Destroy GL context when releasing dummy surface

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165293386

* Restore the interrupted flag after blocking operations

If the main thread was interrupted during
ExoPlayerImplInternal.blockingSendMessage/release, the interrupted flag was
immediately set but then wait() was called on the next iteration. wait() would
immediately throw InterruptedException, causing the main thread to spin until
the blocking operation completed.

Instead of resetting the flag immediately, reset it after the blocking
operation completes.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165426493

* Work around issue with Xiaomi JB devices

Issue: google#3171

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165577562

* Improve FORMAT_UNSUPPORTED_DRM related documentation and logging

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165580016

* Improve MediaSource/MediaPeriod documentation

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165628229

* expose setPropertyByteArray, setPropertyString

export setPropertyByteArray, setPropertyString of DefaultDrmSessionManager for easy customization.

* Minor style tweaks

* Allow the app to specify extra ad markers

Issue: google#3184

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165895259

* Remove isFirstWindow/isLastWindow from Timeline.

These methods are only used in one place, and offer duplicate
functionality to checking getNext(Previous)WindowIndex == C.INDEX_UNSET.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165910258

* Fix broken link + minor doc tweak

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165920927

* Handle size==0 in MP4 atoms

Issue: google#3191

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165925148

* Use flavorDimensions for external demo app

- This is soon becoming mandatory.
- It also looks like future versions of com.android.tools.build
  are being distributed via Google's Maven repository.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166058299

* Support aspect ratio fill mode for AspectRatioFrameLayout

* Support zoom mode for AspectRatioFrameLayout

* Allow subclasses to customize the MediaFormat

Make getMediaFormat protected so that subclasses can set additional MediaFormat
keys. For example, if the decoder output needs to be read back via an
ImageReader as YUV data it is necessary to set KEY_COLOR_FORMAT to
COLOR_FormatYUV420Flexible.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166195211

* Use Math.abs in Sonic.java

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166820970

* Add support for new codecs parameter string

* google#3215 Additional secure DummySurface device exclusions

* Use UTF-8 everywhere

UTF-8 is the default charset on Android so this should be a no-op change, but
makes the code portable (in case it runs on another platform).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167011583

* Fix ContentDataSource bytesRemaining calculation

The bytesRemaining didn't always take into account any skipped bytes, which
meant that reaching the end of the file was not correctly detected in read().

Issue: google#3216

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167016672

* Allow more aggressive switching for HLS with independent segments

We currently switch without downloading overlapping segments, but
we do not actually switch more aggressively. This change fixes
this. Note there's an implicit assumption made that if one media
playlist declares independent segments, the others will too. This
is almost certainly true in practice, and if it's not the penalty
isn't too bad (the player may try and switch to a higher quality
variant one segment's worth of buffer too soon).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167120992

* HDR 10 bits: Use a separate sampler for U and V dithering.
Using the same sampler introduced some minor horizontal scratches.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167347995

* Fix typo

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167474040

* Minor cleanup to AspectRatioFrameLayout

* Update moe eqiuvalence

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167488837

* Allow EXIF tracks to be exposed

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167493800

* Adding missing license header in IMA build.gradle

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167496569

* Additional secure DummySurface device exclusions

Merge: google#3225

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167502127

* Be robust against unexpected EOS in WebvttCueParser

Issue: google#3228

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167504122

* Rewrite logic for enabling secure DummySurface

Issue: google#3215

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167505797

* Upgrade gradle plugin / wrapper

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167579719

* Don't use MediaCodec.setOutputSurface on Nexus 7 with qcom decoder

Issue: google#3236

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167581198

* Fix position reporting during ads when period has non-zero window offset.

Reporting incorrect positions for ad playbacks was causing IMA to
think the ad wasn't playing, when in fact it was.

Issue: google#3180

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167702032

* Workaround for SurfaceView not being hidden properly

This appears to be fixed in Oreo, but given how harmless
the workaround is we can probably just apply it on all
API levels to be sure.

Issue: google#3160

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167709070

* DecryptionException cleanup + add missing header

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167711928

* Pick up rtmpClient fix

Issue: google#3156

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167718081

* Enable rtmp in external demo app with extensions

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168007345

* Destroy EGLSurface during DummySurface cleanup

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168020525

* Fix attr inheritance in SimpleExoPlayerView

When creating PlaybackControlView inside SimpleExoPlayerView,
we want certain attributes to be passed through. This lets you
set control attributes on the SimpleExoPlayerView directly. We
don't want all attributes to be propagated though; only our own
custom ones.

Not sure if there's a cleaner way to do this. Pragmatically this
solution seems ... ok :)?

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=167619801

* Add possibility of forcing a specific license URL in HttpMediaDrmCallback

Resubmit of google#3136

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=164971900

* Fix build for release

* Bump to 2.5.2

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=168155713

* Update extension README with usage instructions

Issue: google#3162

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165572088

* Tweak and add READMEs + remove refs to V1

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=165578518

* Update README.md
@jkellysbgtv
Copy link

Hi there, this issue or one very similar to it seems to still be occurring with a small subset of devices and ads. On a galaxy S3 mini on Android 4.4.2 certain ads still seem to play audio only and no video and when this occurs the same error earlier in this thread is showing.

AdError [errorType: PLAY, errorCode: AdErrorCode [name: VAST_MEDIA_LOAD_TIMEOUT, number: 402], message: VAST media file loading reached a timeout of 8 seconds.]

Reproducible in the exoplayer sample/demo.

@ojw28
Copy link
Contributor

ojw28 commented Sep 20, 2017

Please file a separate issue if there's still a problem from 2.5.2 or later, together with all of the information requested in the issue template. Thanks!

@google google locked and limited conversation to collaborators Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants