• access-control-allow-origin-跨域


    when use  vastinspector to check our  vast response ,it  tiped :

    "no 'access-control-allow-origin' header is present on the requested resource. origin 'https://imasdk.googleapis.com'  is therefore not allow access " on the console ,

    so we had to solve it ,to make sure our video play  smoothly 。

    according the docs :

    Access-Control-Allow-Origin: <origin header value>     
    Access-Control-Allow-Credentials: true

    we add headers before response:
    origin := r.Header.Get("Origin")
    w.Header().Set("Access-Control-Allow-Origin", origin)
    w.Header().Set("Access-Control-Allow-Credentials", "true")

    then our vast can play .

    andskipable vast like this:


    <VAST version="2.0">
        <Ad id="159033832">
            <InLine>
                <AdSystem>doubleclick</AdSystem>
                <Impression><![CDATA[
    https://test.adomain.com/impression?k=598cf38025536d7377e2bcbb&p=NjAyOHwyODAwMHwwfDIyfDE1OTAzMzgzMnw3MDQzMDUwNzN8bm9ybWFsfGRvdWJsZWNsaWNrfDEyMDB4NjI3fDh8YW5kcm9pZHw2LjAuMHx8c20tZzYxMG18fHxVU3x8fHxub3JtYWx8fGNvbS5wb3dlcmQuY2xlYW5lcnx8fHx8fHx8NTk4Y2YzODAyNTUzNmQ3Mzc3ZTJiY2JifDUyLjIzLjExMi4wfHx8fHx8MHwwfDE4OWMzYTQ3LTViMWMtNDIwZi1hNzZlLTgxZWNhMDI1YTMxZHx8fHNhbXN1bmd8fHxyYW5rX2NwbV9jYW1wfHwzfHx8LHRiLGRiLHJlfHsiY2FycmllciI6IjcwMTE5IiwiY2l0eSI6ImFzaGJ1cm4iLCJjdHIiOiIwLjA1IiwiY3R5cGUiOiJjcG0iLCJwYXJzZSI6IjEiLCJyYW5rIjoiMCIsInJlcXR5cGUiOiJ2bmEiLCJzZWFyY2giOiIxIiwidHJhZmZpY190eXBlIjoiYXBwIn18MTUwMjQwOTYwMHx8MXwxMTkxNXx8fHx8fGh0dHBzOi8vcGxheS5nb29nbGUuY29t
    ]]></Impression>
                <Creatives>
                    <Creative id="704305157">
                        <Linear skipoffset="00:00:05">
                            <Duration>00:00:23</Duration>
                            <TrackingEvents>
                                <Tracking event="start"><![CDATA[
    https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id
    ]]></Tracking>
                                <Tracking event="midpoint"><![CDATA[
    https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id=
                                <Tracking event="complete"><![CDATA[
    https://analytics-test.adomain.com/collect?app_id=com.powerd.cleaner&advertiser_id=22&campaign_id=
                            <VideoClicks>
                                <ClickThrough><![CDATA[
    https://test.adomain.com/click?k=598cf38025536d7377e2bcbb&p=
    ]]></ClickThrough>
                                <ClickTracking />
                            </VideoClicks>
                            <MediaFiles>
                                <MediaFile id="1" delivery="progressive" type="video/mp4" bitrate="600" width="1280" height="720"><![CDATA[
    https://d3e8xvf8dyclkj.cloudfront.net/cdn-adn/17/08/04/13/42/5984094d8709d.mp4
    ]]></MediaFile>
                            </MediaFiles>
                        </Linear>
                    </Creative>
                </Creatives>
                <Extensions>
                    <Extension>
                        <CustomTracking>
                            <Tracking event="skip"><![CDATA[
    https://test.xxx.com/impression?k=11&p=200
    ]]></Tracking>
                        </CustomTracking>
                    </Extension>
                </Extensions>
            </InLine>
        </Ad>
    </VAST>
     
     
  • 相关阅读:
    Cocos2dx 学习笔记(6) 场景对象的移动
    Torque2D MIT 学习笔记(14) 动画资源(AnimationAsset)
    Cocos2dx 学习笔记(4) 对笔记3中触摸控制的第二种实现
    Torque2D MIT 学习笔记(12) 资源基类(AssetBase)
    Torque2D MIT 实战记录: 塔防进度(2)
    Torque2D MIT 学习笔记(17) 如何遍历与查询资源
    Torque2D MIT 实战记录: Isometric(等轴视距)
    Torque2D MIT 脚本阅读(4) ChainToy
    Torque2D MIT 实战记录: 塔防进度(1)
    Torque2D MIT 学习笔记(16) 物理系统(2)
  • 原文地址:https://www.cnblogs.com/lavin/p/7347842.html
Copyright © 2020-2023  润新知