googleads / videojs-ima

IMA SDK Plugin for Video.js
Apache License 2.0
450 stars 284 forks source link

.ima property/object not available on videojs instance. #1081

Closed Nonchalantcode closed 1 year ago

Nonchalantcode commented 1 year ago

Hi 👋 !

I hope this isn't a too newbt question but I am trying to develop some custom functionality by modifying the PlayerWrapper.prototype object in the player-wrapper.js file.

After installing the dependencies and running the rollup command, everything seems to compile just fine but the .ima object that defines the functionality of your plugin is null. What I mean by this is that the .ima object is not available in the videojs instance I create. Is there something that I'm missing? I already tried out your plugin and it works perfectly but I need to add some custom functionality to it that I just can't add via monkey patching in this case. It's something I need to do directly in the source file.

Help please, Hector

Kiro705 commented 1 year ago

Hello @Nonchalantcode ,

I do not think IMA support will be able to advise on how to manually add custom code into the plugin.

However, if you see the plugin as lacking a feature, please expand on that as a feature request for the plugin, and I can look into adding support in a future release.

Thank you, Jackson IMA SDK team

Nonchalantcode commented 1 year ago

Hi @Kiro705 ,

Thank you so much for taking the time to answer. I'm kinda new to using VideoJS and it's ecosystem (including your excellent plugin) but after reading more of videojs's docs on plugin development I found out that the changes I had done to the code of the plugin were in fact correct, and the reason the .ima property wasn't available on my videojs instance at the moment was because the plugin hadn't been fully registered. So it was just a matter of listening to the pluginsetup:ima event to fire on the videojs instance (which is when the plugin is fully registered).

Thanks again, Hector