skip to Main Content

First of all I’m using wordpress with elementor plugin and the accordion feature.

I’ve got a code of video player:

<div id="player_div"></div><script src="https://lnaff.pl//API_VIDEO/LOCKER/js.js"></script><script> var ustawienia = {element_id:"player_div",
wysokosc:"455",
szerokosc:"800",
skin:"1",
czas_blokady:"19",
dlugosc_filmu:"2589",
video_url:"http://androidapkmodpro.com/wp-content/uploads/2020/01/Intro.mp4",
video_img:"https://i.imgur.com/YvKvkYL.png",
stream:"0",
programy_url:["https://leadnet.pl/p_uri/q6pYwlgb27QyvVjdPke1/x1vo6wa/?parametr=",],
player_button:["https://i.imgur.com/ACzzOnz.png",],
}; LEADNETWORK_generuj_player(ustawienia);</script>

I need to put in on several places on the same page. When I tried just multiple copy->paste, only in one place is showing. Is it possible? Any advices?

2

Answers


  1. Please take a look at first line:

    <div id="player_div"></div><script src="https://lnaff.pl//API_VIDEO/LOCKER/js.js"></script><script> var ustawienia = {element_id:"player_div",
    

    It says basically that the video is put into a div with id=player_div due to element_id:"player_div". If you change the first line to something like:

    <div id="my_second_video_placeholder"></div><script src="https://lnaff.pl//API_VIDEO/LOCKER/js.js"></script><script> var ustawienia = {element_id:"my_second_video_placeholder",
    

    it’s highly probable that it would work.

    Login or Signup to reply.
  2. If you copy and paste this code in multiple locations you will load the code and declare the same variables twice, which for Javascript won’t work. The “ustawienia” variable is also pointing to the player_div, and with HTML id’s this will only find the first one.

    <script src="https://lnaff.pl//API_VIDEO/LOCKER/js.js"></script><!-- only include once -->
    
    <div id="player_div1"></div> <!-- div for first video -->
    <div id="player_div2"></div> <!-- div for second video -->
    
    <script> 
    var video1 = {element_id:"player_div1",
      wysokosc:"455",
      szerokosc:"800",
      skin:"1",
      czas_blokady:"19",
      dlugosc_filmu:"2589",
      video_url:"http://androidapkmodpro.com/wp-content/uploads/2020/01/Intro.mp4",
      video_img:"https://i.imgur.com/YvKvkYL.png",
      stream:"0",
      programy_url:["https://leadnet.pl/p_uri/q6pYwlgb27QyvVjdPke1/x1vo6wa/?parametr=",],
      player_button:["https://i.imgur.com/ACzzOnz.png",],
    }; 
    var video2 = {element_id:"player_div2",
      wysokosc:"455",
      szerokosc:"800",
      skin:"1",
      czas_blokady:"19",
      dlugosc_filmu:"2589",
      video_url:"http://androidapkmodpro.com/wp-content/uploads/2020/01/Intro.mp4",
      video_img:"https://i.imgur.com/YvKvkYL.png",
      stream:"0",
      programy_url:["https://leadnet.pl/p_uri/q6pYwlgb27QyvVjdPke1/x1vo6wa/?parametr=",],
      player_button:["https://i.imgur.com/ACzzOnz.png",],
    }; 
    
    LEADNETWORK_generuj_player(video1);
    LEADNETWORK_generuj_player(video2);
    </script>
    

    Now I’ve not used the lead network video player, but this should work without issue. For each new video, you would need to create a new target DIV tag and a new video variable in the script section.

    Hope this helps.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search