google / google/ExoPlayer

Support timed messages (PlayerMessage) for ads

Open
#10,506 1 comment 1 reaction 1 assignee Assigned to @tonihei View on GitHub
enhancement
Dominant language
Java
Stars
21.9k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

### 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:
```kotlin
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()
}
```
3. 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 dev.exoplayer@gmail.com after filing this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.