11-01-2011 01:43 PM
_adModule.setAdPolicy(adPolicy);
_adModule.setAdRules(adSource);
11-22-2011 11:54 AM
This sounds like a bug. We'll start investigating this but can you provide a simplied ad rules class that shows the issue?
11-27-2011 09:30 AM
Someone should have contacted you about this issue (Crystal) or should shortly. If you don't hear from us, let me know.
01-05-2012 10:20 AM
Thanks for your help, Brian and Crystal.
The bug fix solved the initial issue of setAdRules() not waiting for adRulesReady(), but I've found a related issue now that I need your help with. The scenario again is a playlist of videos, a custom AdRules swf, and an additional video player plugin (AdSource.swf) that dynamically changes the AdPolicy for each video in the playlist.
Everything works as expected when not using the AdSource plugin, on MediaEvent.CHANGE event we reset our ad player and call prerollCheck() to initiate a new ad session while maintaining the same instance of the AdRules class. However, when the AdSource plugin is added it creates a new instance of the AdRules class on each MediaEvent.CHANGE event (presumably when it calls setAdRules), which might be OK except that the VideoPlayer maintains references to the previous instance(s), such as event listeners for MediaEvent.PLAY, MediaEvent.STOP, etc. The result is that each AdRules instance picks up on these events and sends multiple events to multiple ad player instances. After a couple of videos, this could get quite heavy and crash the Flash player.
So my question: Is it the responsibility of the AdSource plugin to use the same instance of the AdRules class for each new item, or is it the responsibility of the AdRules class to properly unload itself (ie. remove all event listeners) when a new instance is created? And in the case of the latter, does the Brightcove API offer any unloading hooks?
Thanks,
Owen.
Brightcove Inc., a leading global provider of cloud content services, provides a family of products used to publish and distribute the world's professional digital media. The company's products include Brightcove Video Cloud, the market-leading online video platform, and Brightcove App Cloud, the pioneering content app platform. Together, more than 4,200 customers in 50 countries rely on Brightcove's cloud content services to build and operate exceptional media experiences across PCs, smartphones, tablets and connected TVs.
Brightcove Inc.
© 2012 Brightcove Inc.
