Jan 6, 2011 at 2:46 PM

Hello, hope you can help me.

I am setting several advertisements to my player, via code, and also I do set the PostRoll one. And it's not playing at all, please take a look and tell me what am I doing wrong?

Probably I have to set up the timing right? I have tried setting the start time as the end of the main clip, also I tried to set it up as the zero one, nothing happened.

 for (int i = 1; i < Configurator.Instance.Config.PlayList.Count; i++)
                        var pli = Configurator.Instance.Config.PlayList[i];
                        var ad = new Advertisement()
                                         AdSource = pli.Url,
                                         DeliveryMethod = DeliveryMethods.AdaptiveStreaming,
                                         Duration = pli.PlayingDuration.Add(new TimeSpan(0, 0, 0, 0, 100)),
                                         StartTime = pli.StartTime,
                                         PauseTimeline = true
                        //if (i == Configurator.Instance.Config.PlayList.Count - 1)
                        //    this.CurrentPlaylistItem.PostRollAdvertisement = ad;
                            if (pli.StartTime == new TimeSpan())
                                this.CurrentPlaylistItem.PreRollAdvertisement = ad;

Jan 6, 2011 at 9:21 PM

I have not done ads on my player but I can see in the code that each IMediaPlugin such as (ProgressiveMediaPlugIn, SmoothStreamingMediaPlugin, etc) has a read only property called SupportsAdScheduling. From what I can see, these are hardcoded to false unless you are using the SmoothStreamingMediaPlugin on the Windows Phone 7. To change this behavior I believe you would need to implement your own IMediaPlugin that set SupportsAdScheuling to True. Then the original code for the SMFPlayer should show your ad.

I haven't tried it, but that might get you there.

Jan 14, 2011 at 9:44 PM

swhook52, the advertising feature is actually NOT enabled for WP7 and IS enabled for the Silverlight 4 version.

mikachi, I don't see anything immediately wrong with your code but would suggest verifying the following:

1) Your playlistitem must be using the SmoothStreaming plugin (DeliveryMethods.AdaptiveStreaming).

2) Make sure your ad's starttime and duration are correct. I'd suggest just hardcoding in values to test with.

3) Make sure your adsource urls are served from the same protocol, domain, and port,... or that you have a clientaccesspolicy.xml...etc file in the root.

If all else fails, take a look to see if your ad's manifest is even being requested by spying with fiddler or a similar tool.

Tim Greenfield

Jan 18, 2011 at 2:16 PM

Thanks Tim,

can you please provide me the definetely working player with the post roll ad? I tried great variety of the combinations, but invain, preroll advertisement works fine, interstitial also, but post roll fails, always.

Thanks in advance.

Jun 24, 2011 at 4:15 PM

Hi, I've the same problem, preroll and interstitial works fine, post roll doesn't work. 



Jul 14, 2011 at 8:54 AM

Hi, isn't there a solution for this issue?

Thanks and regards,