видеообъявления не воспроизводятся - PullRequest
0 голосов
/ 20 сентября 2019

Я использую prebid js для показа своих объявлений, я использую жидкий видеоплеер для запуска видеоплеера.

Вот мое демо: demo

Вот мой js

 <head>
         <script>
            var pbjs = pbjs || {};
            pbjs.que = pbjs.que || [];

            console.log(pbjs);

            // define invokeVideoPlayer in advance in case we get the bids back from prebid before the entire page loads
            var tempTag = false;
            var invokeVideoPlayer = function(url) {
                tempTag = url;
            }

            var videoAdUnit = {
                code: 'video1',
                mediaTypes: {
                    video: {
                        playerSize: [640, 480],
                        context: 'instream'
                    }
                },
                bids: [{
                    bidder: 'appnexus',
                    params: {
                        placementId: 13232361, // Add your own placement id here
                        video: {
                            skipppable: true,
                            playback_method: ['auto_play_sound_off']
                        }
                    }
                }]
            };

            pbjs.que.push(function() {
                pbjs.addAdUnits(videoAdUnit); // add your ad units to the bid request
                pbjs.setConfig({
                    debug: true,
                    cache: {
                        url: 'https://prebid.adnxs.com/pbc/v1/cache'
                    }
                });

                pbjs.requestBids({
                    bidsBackHandler: function(bids) {
                        var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
                            adUnit: videoAdUnit,
                            params: {
                                iu: '/19968336/prebid_cache_video_adunit',
                                cust_params: {
                                    section: 'blog',
                                    anotherKey: 'anotherValue'
                                },
                                output: 'vast'
                            }
                        });
                        invokeVideoPlayer(videoUrl);
                    }
                });
            });

        </script>


   </head>
   <body>
      <video id='my-video' controls style="width: 640px; height: 360px;">
         <source
            src='https://royaladvastplayer.videomill.pl/video/page18-movie-4.mp4'
            type='video/mp4' />
      </video>

      <script>

    console.log('Init starteded');

   var invokeVideoPlayer = function(url) {

      console.log("invoking video player with url " + url);

         var  myFluidPlayer=  fluidPlayer(
            'my-video', {
                  layoutControls: {
                     primaryColor: false,
                     playButtonShowing: true,
                     playPauseAnimation: true,
                     fillToContainer: false,
                     autoPlay: false,
                     preload: false,
                     mute: true,
                     doubleclickFullscreen: true,
                     subtitlesEnabled: false,
                     keyboardControl: true,
                     layout: 'default',
                     allowDownload: false,
                     playbackRateEnabled: false,
                     allowTheatre: true,
                     title: false,
                     logo: {
                        imageUrl: "https://videommerce.com/wp-content/uploads/2019/05/videommerce.png",
                        position: 'top left',
                        clickUrl: null,
                        opacity: 1
                     },
                     controlBar: {
                        autoHide: true,
                        autoHideTimeout: 3,
                        animated: true
                     },
                     timelinePreview: {},
                     htmlOnPauseBlock: {
                        html: "http://meed.audiencevideo.com",
                        height: 600,
                        width: 400
                     },
                     playerInitCallback: (function () {})
                  },
            }
         );
   }

      </script>
      <script async src="//acdn.adnxs.com/prebid/not-for-prod/1/prebid.js"></script>
      <script src="https://cdn.fluidplayer.com/v2/current/fluidplayer.min.js"></script>
      <!-- <script src="js/main.js"></script> -->



   </body>

в моей консоли, здесь нет ошибки.

enter image description here

Когда я нажимаю кнопку воспроизведения, нет рекламывидео отображается даже при том, что URL-адрес видео вызывается в моем видеопроигрывателе.

Что не так с моим кодом?

...