IMA ads Media3 Exoplayer - Change Ima tag url on runtime without reinitializing the exoplayer player

3 views
Skip to first unread message

Vishnu Khandelwal

unread,
Nov 18, 2025, 3:12:35 AM (22 hours ago) Nov 18
to Interactive Media Ads SDK

I have a media3 exoplayer that uses an M3U8 URL (a playlist file for streaming video, like HLS) and the video content supports multiple audio languages (e.g., English, Spanish, French).


When a user switches the video's audio track (e.g., from English to Spanish), I want to update the advertising parameters to tell my ad server the user's current language. This is usually done by adding a language code (like es for Spanish) to a key, often called cust_params (custom parameters).


The Current, Bad Experience 😥


Right now, to send the new language code, I have to:


  1. Stop the currently playing video.

  2. Destroy the existing video player instance.

  3. Re-initialize (re-create) a brand new video player instance with the same M3U8 URL, but this time, the cust_params includes the new language code.

  4. Resume playback.

The result: A disruptive user experience. The video playback pauses, the player flashes or reloads, and there's a delay.


I are looking for an existing method or feature in video players or ad integration libraries (like Google IMA SDK) that allows me to change the ad request parameters without reinitializing the entire video player.

The Ideal Scenario ✨
  1. User clicks the language button (e.g., switches to French).

  2. The video's audio track changes instantly.

  3. I call a function (e.g., player.updateAdTargeting('fr')).

  4. The player/SDK registers that the new custom parameter (cust_params: language=fr) should be used for the next ad opportunity (the next pre-roll, mid-roll, or post-roll ad).

  5. Playback continues uninterrupted.

In short, I want to update your ad server's targeting information "on the fly" after a user changes the language, without causing the video to stop and reload.

IMA SDK

unread,
Nov 18, 2025, 9:40:05 AM (16 hours ago) Nov 18
to vishnu.k...@mediologysoftware.com, ima...@googlegroups.com

Hi,

Thank you for contacting the IMA SDK Support Team.

We understand the difficulty you face when needing to update ad targeting parameters (like the language in cust_params) because it currently forces you to stop and reinitialize your ExoPlayer, leading to a poor user experience.

You are asking for a way to update ad targeting on the fly for the next ad opportunity without interrupting video playback.

To assist with troubleshooting, could you please provide the following details:

  • A sample project that shows how you integrate the Media3 ExoPlayer and the IMA SDK, and the code you use to switch the audio track and update the ad parameters.
  • Screen Recording clearly showing the pause, flash, or delay that happens when a user switches the audio track in your current setup.

These details will help us find a non-disruptive solution for updating your ad request parameters for future ad breaks.

Kindly provide the requested details via reply to the author option.

If the file(s) you are looking to share are less than 25mb in total you can attach them to this case on your next reply. If you are having trouble attaching your file to this case or if your file(s) are larger than 25mb, you can share your files with me by performing the following steps:

1. Navigate to

https://docs.google.com/forms/d/e/1FAIpQLSfkAiXMeYP-fw1W3Z-tT9uwmATEKO5X6S-th0gR2ezdKaaqfg/viewform?usp=pp_url&entry.400550049=IMA+SDK&entry.460850823=500Ht00001vTkzCIAS&entry.80707362=00339623

2. Fill out all fields, and attach your file(s).

3. Please reply back on this thread when you have uploaded your file(s). Please do not share this link.

 

Thanks,
 
Google Logo IMA SDK Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5
[2025-11-18 14:39:55Z GMT] This message is in relation to case "ref:!00D1U01174p.!500Ht01vTkzC:ref" (ADR-00339623)



Reply all
Reply to author
Forward
0 new messages