Pregunta

I'm using the following source code to display a video file using Jw Player 6.

<script>
        jwplayer('video-front').setup({
          height: 540,
          width: 980,
          image: "<?php echo $base_url; ?>/sites/default/files/video-front/thumbnail-223_0002.png",
          playlist: [{
            sources: [
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575675.mp4" },
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575748.webm" },
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575648.flv" }
            ]
          }]
        });
      </script>

But the image not display in my video. Only I can see a black background. What's wrong here? Thanks in advance.

¿Fue útil?

Solución

Use this instead:

<script>
        jwplayer('video-front').setup({
          height: 540,
          width: 980,
          playlist: [{
          image: "<?php echo $base_url; ?>/sites/default/files/video-front/thumbnail-223_0002.png",
            sources: [
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575675.mp4" },
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575748.webm" },
              { file: "<?php echo $base_url; ?>/sites/default/files/video-front/1380575648.flv" }
            ]
          }]
        });
      </script>

The image needs to be inside of the playlist block. That should fix it.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top