I am trying to install this VAST JS Tag in Fluid Player and Node.js but I can't

38 Views Asked by At

I am trying to install this VAST JS Tag in Fluid Player and Node.js but I can't, the VAST video ads play underneath the node.js player! the format is different than the regular VAST XML url! and I can't find any related documentation for it!

here's the VAST JS tag:

<script async id="AV657b500ffe71a9305d04457e" type="text/javascript" src=" https://tg1.aniview.com/api/adserver/spt?AV_TAGID=657b500ffe71a9305d04457e&AV_PUBLISHERID=657b23783eea58772b01a098 "></script>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Video Player with VAST</title>
    <link href="https://unpkg.com/video.js/dist/video-js.css" rel="stylesheet">
</head>
<body>
    <div id="player-container" class="video-js vjs-default-skin"></div>

    <script src="https://unpkg.com/video.js/dist/video.js"></script>
    <script async id="AV657b500ffe71a9305d04457e" type="text/javascript" src="https://tg1.aniview.com/api/adserver/spt?AV_TAGID=657b500ffe71a9305d04457e&AV_PUBLISHERID=657b23783eea58772b01a098"></script>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            var player = videojs('player-container');

            // YouTube video ID
            var youtubeVideoId = 'YOUTUBE_VIDEO_ID';

            // Construct the YouTube embed URL
            var youtubeEmbedUrl = 'https://www.youtube.com/embed/' + youtubeVideoId;

            // Set up the video source
            player.src({
                type: 'video/youtube',
                src: youtubeEmbedUrl
            });

            // Example: Listen for VAST ad loaded event
            document.getElementById("AV657b500ffe71a9305d04457e").addEventListener("onAdLoaded", function(event) {
                // Assuming videojs-contrib-ads plugin is used
                player.ads.startLinearAdMode();
            });
        });
    </script>
</body>
</html>

I tried different way in Fluid Player and Node.js

0

There are 0 best solutions below