question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Playlist with Ads - Wrap Playlist with 1 Ads Source.

See original GitHub issue

I have 3 MediaItem(s) in a playlist and I would like to wrap them with 1 Ad Playlist, i.e. the pre-roll plays before the first media item, the mid-rolls plays through the first, second and third media item and the end-roll plays at the end of the third media item.

I had a look at the documentation, and found that:

It’s possible to customize this behavior by passing an opaque ads identifier with which ad playback state for a given media item is linked, based on object equality. Here is an example where ad playback state is linked to the ad tag URI only, rather than the combination of the media ID and ad tag URI, by passing the ad tag URI as the ads identifier. The effect is that ads will load only once and the user will not see ads on the second item when playing the playlist from start to finish.

This customisation didn’t work for us, since no ads were played in the second item (the post-roll was triggered before the start of the second media item).

I also tried wrapping the 3 MediaItem(s) in a ConcatenatingMediaSource and then wrap the resulting ConcatenatingMediaSource with an AdsMediaSource. That didn’t work and threw an exception.

Is there any way to achieve this? Would I need to build my own AdsLoader for this?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewlewiscommented, Sep 13, 2021

I don’t think there are any alternative approaches that work at the moment – you’d need to work around the problem by splitting the ad tag as suggested above, or find a way to join the content pieces into one period. https://github.com/google/ExoPlayer/issues/3693 tracks removing the limitation that the content media source may only have one period.

0reactions
icbakercommented, Sep 1, 2021

@andrewlewis can you take a look and see if there are any alternative approaches here that I’ve missed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

wrapped 2021 only showing 1 playlist - The Spotify Community
wrapped 2021 only showing 1 playlist ... About nothing showing in the app but the Top 100 playlist, have you already double-checked you're ......
Read more >
Video Multiple Ad Playlist (VMAP) - Version 1.0 - IAB
VMAP represents a playlist structure that wraps one or more ad responses. This structure defines the ad breaks within a video program, ...
Read more >
A Look Behind Blend: The Personalized Playlist for You…and ...
We modified the Blend Data Stories to use data from Wrapped, to show users information like their top mutual artists and top mutual...
Read more >
Implementing Playlists - Brightcove Player Documentation
In this topic, you will learn the how to use playlists to display a collection of videos that are grouped together in a...
Read more >
Spotify Wrapped is free advertising that says nothing about the ...
But more often I bang on my playlist – dating back to July 2017 ... out Wrapped this year, like the Grinch listening...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found