Jump to content

Revive 5.5.0 Can't retrieve Inline Video ad with fetch


Recommended Posts

I've defined a zone with type Inline Video ad. The VAST2 Invocation Code is https://{myHost}/www/delivery/fc.php?script=apVideo:vast2&zoneid=1

If I enter this in the url field of Microsoft Edge, it returns an XML document; however, if I use it as the url argument to fetch, it returns an empty object.

I created a simple test html file, and still does not return the xml contents that are returned by directly accessing the url via a browser. What is the difference?

        <meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'">
        <script type="text/javascript">
            async function fetchVideo() {
                var url = 'https://{myHost}/www/delivery/fc.php?script=apVideo:vast2&zoneid=1'
                let response = await fetch(url, { mode: 'no-cors' })
                let xmlText = await response.text()
                return xmlText
            console.log(`fetchVideo: ${fetchVideo()}`)
    Happy Happy Joy Joy

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...