Android Streaming Video With ExoPlayer 2 ( With IMA Ads)

Amardeep Yadav

Hello there, My name is Amardeep founder of I have experience in many technologies like Android, Java, Php etc. In this variety of technologies, I love Android App Development. If you have any idea and you want me to develop for you then let's have chat Email: [email protected]

You may also like...

44 Responses

  1. Mayank Langalia says:

    Hello sir. I need small help. I want to add my custom advertisement is it possible or not ? Also i want to add advertisement indication (Yellow dot). Please help me Im stuck last few days.

  2. Nadeem Ahmad says:

    m3m8 code not work plz help

  3. Gürkan says:

    Can you help me to How I can change embedded subtitle and track in Hls?

  4. Artan says:

    Hi Amardeep, Can you please tell me how I can listen to ads events such as adError(), adPaused(), adResumed() and adFinished()?
    I have been trying to do this for the past 2 days, still no result.
    I have this code which is playing the ads but I can not listen to ads events:
    MediaSource mediaSourceWithAds = new AdsMediaSource(

  5. Vivek Shukla says:

    Hii Sir I followed the process but the video didn’t streamed

  6. Manoj says:

    using the IMA Extension can we show ads in between the videos?

  7. soksan says:

    Hi sir, how can we set Aspect Ratio in this player?


  8. JRB says:


    Can we play m3u8 extension files with the same code?

  9. Android Developer says:

    Can we play Facebook or Vimeo video in this player? If yes, how can I do that?

    • Thanks for your question, Facebook and Vimeo don’t provide there media source URLs as per my knowledge. But maybe there is a way to get these Media Source URLs by using there API. Read there API and find a way to obtain Media Source URLs. If you find Media Source URL then it is easy to implement with ExoPlayer.

      Now Media Source is ready, pass it to play with ExoPlayer
      To start Playing Video

  10. Kalpesh Bhangare says:

    Good Work, Sir How can I create a playlist of video or audio using ExoPlayer?

    • Thank You Mate, You can use ConcatenatingMediaSource. Refer this example to create PlayList of video or audio using ExoPlayer

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.