Ads on Chromecast receiver app

566 Views Asked by At

I have a Chromecast receiver app, My requirement is to show ads after playing video few seconds and after completion of ads player will resume the ongoing video.I search on google and came to know that for media ads, IMA SDK can be used. Can anybody help me to integrate IMA SDK with Chromecast receiver App.

1

There are 1 best solutions below

0
On

The link youtube : IMA in the living room has the tutorial you require.

  1. Change the application id to choose the custom receiver.
  2. Override mediaManager.onLoad. This allows the onLoad to be proxied with ad.
  3. Initialize IMA during onLoad
  4. When you get CONTENT_PAUSE_REQUESTED - save current state.
  5. When you get CONTENT_RESUME_REQUESTED - restore onLoad state.
  6. Override onEnded - so when ad finishes - the event goes to app.
  7. With onResumeRequested, fix up the duration. (Note - recover video length).