11-01-2011 01:43 PM
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?