ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

Support timed messages (PlayerMessage) for ads

Open MisterPotz opened this issue 3 years ago • 1 comments

ExoPlayer Version

2.18.1

Devices that reproduce the issue

emulator api 30

Devices that do not reproduce the issue

No response

Reproducible in the demo app?

Not tested

Reproduction steps

  1. Have an AdsLoader implemented. Inserts ads in start of the content. Content is HLS.
  2. When Player starts playing ad, in event callback register the following messages:
for (quartile in listOf(Quartile.Q25, Quartile.Q50, Quartile.Q75)) {
          player
              .createMessage { _, payload ->
                  onNewQuartileEvent(quartile, payload)
              }
              .setPayload(myPayload)
              .setDeleteAfterDelivery(true)
              .setPosition(quartile.getPositionForDuration(player.duration))
              .send()
}
  1. Registered callbacks will never happen during ad playback. Expected result: it happens during ad playback

If don't use setPosition, events will be successfully delivered but the whole point is lost.

Expected result

PlayerMessage instances are delivered to their targets when an ad is currently playing and their positions are within ad duration.

Actual result

PlayerMessage instances are not delivered to their targets when ad is playing.

Media

Not applicable

Bug Report

  • [ ] You will email the zip file produced by adb bugreport to [email protected] after filing this issue.

MisterPotz avatar Aug 05 '22 15:08 MisterPotz

The position in a PlayerMessage is relative to the content not the ad. I'll mark it as an enhancement to support sending messages to ad break positions.

tonihei avatar Aug 08 '22 09:08 tonihei