WP8 - Smooth Streamed video unwatchable after preroll ad

Topics: Windows Phone 8
Dec 10, 2012 at 7:40 AM

Hi, 

I posted similar to this as a comment on another thread, but I figured I'd expand here.

Basically, the repro is download the playerframework source, open up Microsoft.WP8.PlayerFramework.SL.Test and change the content to the below.

I'm hopeful that you are able to replicate the problem! Wait for the ad to finish (might be a couple of them) then watch the SS video tank. As an aside, if you play the MP4 version of buck, then there a no problems (i.e. thinking borked SS DLL). 

<mmppf:MediaPlayer x:Name="player" Source="http://ecn.channel9.msdn.com/o9/content/smf/smoothcontent/bbbwp7/big buck bunny.ism/manifest">            <mmppf:MediaPlayer.Plugins>                <adaptive:AdaptivePlugin />                <ads:AdSchedulerPlugin>                    <ads:AdSchedulerPlugin.Advertisements>                        <ads:PrerollAdvertisement>                            <ads:PrerollAdvertisement.Source>                                <ads:RemoteAdSource Uri="http://smf.blob.core.windows.net/samples/win8/ads/vast_adpod.xml" Type="vast"/>                            </ads:PrerollAdvertisement.Source>                        </ads:PrerollAdvertisement>                    </ads:AdSchedulerPlugin.Advertisements>                </ads:AdSchedulerPlugin>                <ads:AdHandlerPlugin/>
            </mmppf:MediaPlayer.Plugins>        </mmppf:MediaPlayer>

 

Whilst I'm here, might as well ask - is there a way to easily remove the "more info..." text that is shown over the ad? Removing the ad click all together would be awesome (most clients of mine hate it, and they cannot leave the click URL out from the VAST provider as it's a required field). 

Coordinator
Dec 10, 2012 at 6:06 PM

Regarding turning off the link, you can set the style of the ad player via:

var adFactoryPlugin = player.Plugins.OfType<AdPlayerFactoryPlugin>().First();
adFactoryPlugin.VpaidVideoAdPlayerStyle = myStyle;

Also, here's the default xaml used on the phone to serve as a staring point:

<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:Microsoft.PlayerFramework.Advertising"
    >

    <Style TargetType="local:AdHost">
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ContentControl">
                    <Grid x:Name="LayoutRoot" Background="{TemplateBinding Background}">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="AdvertisingStates">
                                <VisualState x:Name="Linear"/>
                                <VisualState x:Name="Nonlinear">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="VerticalAlignment" Storyboard.TargetName="LayoutRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <VerticalAlignment>Bottom</VerticalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="HorizontalAlignment" Storyboard.TargetName="LayoutRoot">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <HorizontalAlignment>Center</HorizontalAlignment>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <HyperlinkButton x:Name="ClickThroughButton" Foreground="White" FontSize="48" Margin="10" Content="more info..." HorizontalAlignment="Center" VerticalAlignment="Top" Visibility="Collapsed"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>