google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

Playing ads without content #5635

Closed bryandunbar42 closed 5 years ago

bryandunbar42 commented 5 years ago

Is it possible to use AdsMediaSource without a ContentMediaSource?

andrewlewis commented 5 years ago

Please see #3774.

bryandunbar42 commented 5 years ago

Thanks for the response, but i don’t think AdMob is a viable solution if you want to use vast tags (as far as I know). The real use case here is inserting ads into a playlist. Since that is not currently implemented it would be nice to simply prefetch an ad with ImaAdsLoader then switch source to play simply the add, then switch source back to the playlist. There would be some buffering but it’s the cleanest workaround i can think of.

I guess I could also implement a “dummymediasource” or attach the ad to a 1 second black video

andrewlewis commented 5 years ago

I see. If you follow along #3750 that should be updated when we get round to supporting concatenation of ImaAdsLoaders (hopefully soon!).

bryandunbar42 commented 5 years ago

Yep. I’m following that one. I’ll need to try a workaround for now. I’m going to try writing a dummy media source first. I’ll report back if it works out.