ExoPlayer
ExoPlayer copied to clipboard
Support timed messages (PlayerMessage) for ads
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
- Have an
AdsLoaderimplemented. Inserts ads in start of the content. Content is HLS. - 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()
}
- 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 bugreportto [email protected] after filing this issue.
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.