How to prevent playback of videos contained within the Jwplayer Playlist

0

Hello, I would like your help to try to solve this problem. I'm trying to avoid running the videos contained within the Jwplayer playlist when they are clicked, because I'm using a link redirection process, and opening the video is delaying page redirection. Once the player is on a separate page to be loaded inside an iframe.

I'm using this method because the player is as a Wordpress page, and the settings of the template I'm using, use this type of adaptation, for other players.

I changed the parameter window.location.href (obitated along with the total correction of the code in the previous answer given by the user Netinho Santos ) for window.top.location.href , to open the link outside the iframe. The redirection is working perfectly, but this one is presenting the problem mentioned above.

I'd like to know how I can solve this problem. In order to perform this procedure, keeping the first video working and applying this procedure to other videos that are not in the first position of the playlist.

Below is the code.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta name="robots" content="noindex">
        <meta name="googlebot" content="noindex">
                <script src="https://content.jwplatform.com/libraries/As3vnHJG.js"></script><scripttype="text/javascript">
        /* <![CDATA[ */
        var JWp = {

            'flashplayer': '//cdn.jsdelivr.net/jwplayer/5.10/player.swf',
            'skin-name': 'seven',
            'skinactive': '#0099ff',
            'skininactive': '#f9f9f9',
            'skinbackground': '#000000',
            'logofile': '',
            'logoposition': 'top-right',
        };
        /* ]]> */
        </script>
<style type="text/css">
<!--
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
-->
</style>
    </head>
    <body data-rsssl=1>
        <div id="player"></div>
        <script type="text/JavaScript">
            var playerInstance = jwplayer("player");
            playerInstance.setup({
                playlist: [{
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
},
{
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: '1',
  site: 'http://meusite.com',
}, {
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
  site: 'http://meusite.com',
}, {
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
  site: 'http://meusite.com',
}, {
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
  site: 'http://meusite.com',
}, {
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
  site: 'http://meusite.com',
}, {
  file: '//content.jwplatform.com/videos/i3q4gcBi-cIp6U8lV.mp4',
  image: 'imagem',
  title: 'titulo',
  site: 'http://meusite.com',
}, ],
                mute: "false",
                autostart: "false",
                repeat: "false",
                abouttext: JWp.abouttext,
                aboutlink: JWp.aboutlink,
                height: "100%",
                width: "100%",
                stretching: "uniform",
                primary: "html5",
                flashplayer: JWp.flashplayer,
                preload:"metadata",
                skin: {
                    name:JWp.skinname,
                    active:JWp.skinactive,
                    inactive:JWp.skininactive,
                    background: JWp.skinbackground
                },
                logo: {
                    file:JWp.logofile,
                    hide:"false",
                    link:JWp.logolink,
                    margin:"15",
                    position:JWp.logoposition
                }
            });
jwplayer('player').onPlay(function(event) {

  index = jwplayer('player').getPlaylistIndex();
  item = jwplayer('player').getPlaylistItem(index);
  if(index > 0){ window.top.location.href = item.link }
});
        </script>
    </body>
</html>
    
asked by anonymous 08.08.2018 / 21:47

0 answers