Overriding VpaidNonLinearViewModel, SetAdvertising transition to "none" not fired after nonlinear stops.

Topics: Windows 8 Xaml
Oct 5, 2012 at 4:49 PM

I am writing a custom Nonlinear Ad View Model, and adding behaviour to the player controls bar while the non-linear is visible.  When the ad finishes displaying, I want the the MediaPlayer to revert to the default interactive view model, but the CustomAdHandlerPlugin SetAdvertisingState(adState) method doesn't always fire after the ad finishes.  In all cases, the vpaid_AdStopped() handler is called, but only the first ad has the appropriate transition ("Nonlinear" ==> "None") fire.  Subsequently, transitions only fire on ad start.

Logs below:

String time="2012-10-05 10:42:59 AM"
--MediaPlayerState:Playing
CustomAdHandlerPlugin time="2012-10-05 10:42:59 AM"
   <SetAdvertisingState transitionFrom="None" transitionTo="Loading" />
String time="2012-10-05 10:42:59 AM"
--MediaPlayerState:Paused
String time="2012-10-05 10:42:59 AM"
--MediaPlayerState:Paused
CustomAdHandlerPlugin time="2012-10-05 10:42:59 AM"
   <SetAdvertisingState transitionFrom="Loading" transitionTo="NonLinear" />
CustomNonLinearAdViewModel - 2012-10-05 10:43:00 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStarted" time="00:00:00.4527488" />
String time="2012-10-05 10:43:00 AM"
--MediaPlayerState:Playing
CustomNonLinearAdViewModel - 2012-10-05 10:43:21 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStopped" time="00:00:21.4432811" />
CustomAdHandlerPlugin time="2012-10-05 10:43:21 AM"
   <SetAdvertisingState transitionFrom="NonLinear" transitionTo="None" />
CustomAdHandlerPlugin time="2012-10-05 10:43:30 AM"
   <SetAdvertisingState transitionFrom="None" transitionTo="Loading" />
CustomAdHandlerPlugin time="2012-10-05 10:43:30 AM"
   <SetAdvertisingState transitionFrom="Loading" transitionTo="NonLinear" />
CustomNonLinearAdViewModel - 2012-10-05 10:43:30 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStarted" time="00:01:59.9990768" />
String time="2012-10-05 10:43:30 AM"
--MediaPlayerState:Playing
String time="2012-10-05 10:43:30 AM"
--MediaPlayerState:Playing
CustomNonLinearAdViewModel - 2012-10-05 10:44:00 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStopped" time="00:02:30.1717987" />
CustomAdHandlerPlugin time="2012-10-05 10:46:31 AM"
   <SetAdvertisingState transitionFrom="NonLinear" transitionTo="NonLinear" />
CustomNonLinearAdViewModel - 2012-10-05 10:46:31 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStarted" time="00:04:59.8574829" />
CustomNonLinearAdViewModel - 2012-10-05 10:46:41 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStopped" time="00:05:10.0871582" />
CustomNonLinearAdViewModel - 2012-10-05 10:47:01 AM"
   <SetAdvertisingState transitionFrom="NonLinear" transitionTo="NonLinear" />
CustomNonLinearAdViewModel - 2012-10-05 10:47:01 AM"
   <CustomNonLinearAdViewModel state="vpaid_AdStarted" time="00:05:29.8111572" />

Is there anything I ought to be doing to ensure that the SetAdvertisingState transition from "NonLinear" to "None" occurs properly?

Thanks,
Rob