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

audio ads #71

Open
timstoute opened this issue Apr 13, 2023 · 1 comment
Open

audio ads #71

timstoute opened this issue Apr 13, 2023 · 1 comment

Comments

@timstoute
Copy link
Contributor

Can anyone offer any insight into how I can incorporate support for audio ads into this plugin? I'd like the ability to inject an audio advert into the player queue every x tracks.

Perhaps something like Google's Interactive Media Ads SDK would work, but the Swift side of things is out of my comfort zone.

@emilsaj
Copy link
Contributor

emilsaj commented Apr 13, 2023

For iOS I have opted to setting a new playlist with only the audio ad and then when the ad has finished I switch back to the original playlist with the actual audio tracks. I do this dynamically in the beginning of an audio track and in the middle of an audio track for specific tracks.

For Android this solution was not possible, since permissions are different in regards to executing commands while in background. Android will not run code after ~4 minutes of background mode, which means we cannot dynamically play ads whenever it's needed, if the app is in the background.
Only solution I found for this without too much hassle was to have the audio files for the ads be part of the queue and thus be played before the podcast and after the podcast that holds the ads, instead of in the middle of the podcast. A side effect of this approach is that users can currently skip the ads through the notification navigation since it cannot be disabled through this plugin currently. But that is not a big issue for us - especially since we have 80% of our users on iOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants