googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
445 stars 285 forks source link

Calls to pause/resume pre-rolls not working #1140

Open Nonchalantcode opened 2 months ago

Nonchalantcode commented 2 months ago

Hi!

I've noticed the following behavior with your plugin and I'm wondering if you've seen this before or if you've any insights as to this might be happening: given some <div id="container-div"></div> that has as a child a <video /> that will play a VAST tag through video.js + your plugin, if you append (or just place anywhere) the #contrainer-div mentioned previously to another part of the DOM tree, the controls to pause/resume the video will stop working. The calls seems to be made to the methods from what I could see in the library code by placing some console.log calls there, but they seem to be have no effect anymore.

Do you have any insights regarding this? Any idea of how I could prevent this from happening. I'm not sure if this is a bug or lack of feature, if it's either I'd be more than happy to help with this, but getting some insights on this might send me in the right direction.

I'm sharing a Stackblitz demo link so that you can see what I mean:

https://stackblitz.com/edit/stackblitz-starters-f2auud?file=index.html

(NOTE: please open the preview link in the new tab. The button/icon to do so is located in the top-right corner)

Thanks!

Kiro705 commented 2 months ago

Hello @Nonchalantcode ,

The IMA SDK expects the DOM to be static once the IMA SDK is initiated. Please see support and compatibility guide for more info. This is a limitation of the IMA SDK itself, and not this plugin.

Would it be possible to modify your use-case to only initiate the SDK once all DOM alterations have been completed?

Thank you, Jackson IMA SDK team

Nonchalantcode commented 2 months ago

Hi @Kiro705 !

Thanks for taking the time to reply.

Would it be possible to modify your use-case to only initiate the SDK once all DOM alterations have been completed?

Unfortunately no as the DOM alterations will always happen -- or I need them to happen -- after the SDK is available. I think I've reach a dead end here and will need to do a re-write of some stuff to avoid this issue altogether.

Again, thanks for taking the time to reply, Hector

Nonchalantcode commented 1 month ago

Hi @Kiro705 !

I ended up working around the IMA SDK implementation in another way. If you want to close this issue, feel free to do so.

Regards, Hector