none
Advertisement tracking for media player framework RRS feed

  • Question

  • Hello,
    I am using Media Player Framework to play ads in my uwp video streaming app. I am using pre-roll and multiple mid-roll ads. Now, I want to track those ads. I want to launch my method whenever ad starts.

    My media Player code looks like -

    <my:MediaPlayer Name="Display"  MediaStarted="Display_MediaStarted"  MediaEnded="Display_MediaEnded"  MediaOpened="Display_MediaOpened"  CurrentStateChanged="Display_CurrentStateChanged">
                <my:MediaPlayer.Plugins>
                    <ads:AdSchedulerPlugin>
                        <ads:AdSchedulerPlugin.Advertisements>
                            <ads:PrerollAdvertisement>
                                <ads:PrerollAdvertisement.Source>
                                    <ads:RemoteAdSource Name="vastSource" Type="vast"/>
                                </ads:PrerollAdvertisement.Source>
                            </ads:PrerollAdvertisement>
                        </ads:AdSchedulerPlugin.Advertisements>
                    </ads:AdSchedulerPlugin>
                    <ads:AdHandlerPlugin/>
                </my:MediaPlayer.Plugins>
            </my:MediaPlayer>

    I tried the below check inside media player state change event - 

    if(Display.AdvertisingState == Microsoft.PlayerFramework.AdvertisingState.Loading)
    {
    methodCall();
    }

    But this is working only once during pre-roll ad. I want to track all the ads when they start playing. Please help me out with this query. Thanks in advance!

    • Edited by Garima Bhasin Thursday, January 11, 2018 5:51 AM
    • Moved by Breeze Liu Friday, January 12, 2018 9:58 AM off topic
    Thursday, January 11, 2018 5:38 AM

All replies

  • Hi Garima Bhasin,

    thanks for posting here.

    For your case relates to Media Player Framework, your case should be discussed in the Player Framework Discussion Topics. It is not suitable in UWP forum.

    Best Regards,

    Yong Lu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, January 12, 2018 10:00 AM
  • Hi Yong Lu,

    I am not being able to find Player Framework topic in MSDN forum. Can you help me out in posting this question to the respective forum.


    Wednesday, January 17, 2018 5:32 AM
  • Hello,
    I am using Media Player Framework to play ads in my uwp video streaming app. I am using pre-roll and multiple mid-roll ads. Now, I want to track those ads. I want to launch my method whenever ad starts.

    My media Player code looks like -

    <my:MediaPlayer Name="Display"  MediaStarted="Display_MediaStarted"  MediaEnded="Display_MediaEnded"  MediaOpened="Display_MediaOpened"  CurrentStateChanged="Display_CurrentStateChanged">
                <my:MediaPlayer.Plugins>
                    <ads:AdSchedulerPlugin>
                        <ads:AdSchedulerPlugin.Advertisements>
                            <ads:PrerollAdvertisement>
                                <ads:PrerollAdvertisement.Source>
                                    <ads:RemoteAdSource Name="vastSource" Type="vast"/>
                                </ads:PrerollAdvertisement.Source>
                            </ads:PrerollAdvertisement>
                        </ads:AdSchedulerPlugin.Advertisements>
                    </ads:AdSchedulerPlugin>
                    <ads:AdHandlerPlugin/>
                </my:MediaPlayer.Plugins>
            </my:MediaPlayer>

    I tried the below check inside media player state change event - 

    if(Display.AdvertisingState == Microsoft.PlayerFramework.AdvertisingState.Loading)
    {
    methodCall();
    }

    But this is working only once during pre-roll ad. I want to track all the ads when they start playing. Please help me out with this query. Thanks in advance!

    • Merged by Barry Wang Monday, January 22, 2018 5:53 AM same issue
    Saturday, January 20, 2018 7:14 AM