Loading VAST adverts cause multiple firstchance exception in Version 1.1 of player, but not in ver 1.0

Topics: Windows 8 Xaml
Feb 22, 2013 at 11:20 AM
since installing the latest version of the player framework, most of my VAST ad roll's fail to load.

Testing the same application with the old version 1.0 of the framework does not have this issue which suggests that there is nothing wrong with the VAST xml being returned from our ad server. Unfortunately I cannot revert to version v1.0 because of other issues it had.

When observing the action in Visual studio, The output window fills with, the mess I have copied in below. When I detect a load AdFailure via the AdhandlerPlugin, I have to call CancelActiveAds() and bin the whole commercial break, if I do not the Main video begins playing underneath the current playing advert (assuming at least one loaded correctly in the first instance). One other thing I noted was that in the event of an Ad fail, if I have not set player.AutoLoad = true, the main video will not start instead it returns to the poster page.



A first chance exception of type 'System.Exception' occurred in Microsoft.VideoAdvertising.winmd
AD FAILURE: Ad in progress and cannot be canceled.
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.OperationCanceledException' occurred in mscorlib.dll
A first chance exception of type 'System.OperationCanceledException' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
PGEVM - player_AdvertisingStateChanged: None
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.VideoAdvertising.winmd
AD FAILURE: The operation has timed out.
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
PLAYER STATE CHANGED, STATE = Started
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.TimeoutException' occurred in mscorlib.dll
A first chance exception of type 'System.Exception' occurred in Microsoft.VideoAdvertising.winmd
A first chance exception of type 'System.Exception' occurred in mscorlib.dll
A first chance exception of type 'System.Exception' occurred in mscorlib.dll
PLAYER STATE CHANGED, STATE = Started
Coordinator
Feb 27, 2013 at 5:50 PM
For other users experiencing this, here are some helpful hints:
  1. When calling .Play() manually to start a video, set .AutoPlay = false (or just rely on AutoPlay = true).
  2. If calling .Play() manually, it is best to call from the MediaOpened event. Play is what kicks off the pre-roll and you will want to make sure your media successfully loaded before doing so.
  3. You must set AutoLoad = true to get the main media to load (note: true is the default value). Setting AutoLoad = false tells the player framework to not set the source on the internal MediaElement until AutoLoad is set back to true.
Alternative to using AutoLoad, there’s an optional feature you could take advantage of: the MediaLoading event is a deferrable event and fires just before the source on the underlying MediaElement is set. This would allow you to get a deferral, do things like parental control checks and release the deferral if successful. In other words: this would allow you to leave AutoLoad = true the whole time.
Apr 15, 2013 at 1:10 PM
Hi Guys,
I have noticed some strange bahviour related to this error
When the app is in Debug Mode:
Ads will not load they will Throw the above errors.
Install the app in Debug Mode -> Stop Debugging and run the app :
The Ads will not load and things seem fine again

Perhaps someone already knows why this happens
but maybe it might help someone who does not see any ads.
Coordinator
Apr 15, 2013 at 6:01 PM
I'm guessing this is because you have VS set to break on "Thrown" exceptions as well as "Unhandled"...
Image
There are cases where exceptions will be thrown but handled and if you have "thrown" checked, it will break on them regardless. Unchecking will let the program run as if it was deployed on your user's machine. To change, go to Debug > Exceptions in Visual Studio.