Note that there are some explanatory texts on larger screens.

plurals
  1. POYoutube javascript API (& ASP) with multiple videos
    primarykey
    data
    text
    <p>I've got ASP generating the embed code on my page as follows:</p> <pre><code>Table1.Rows(0).Cells(0).Text = "&lt;object style=""height: 390px; width: 640px"" id=""ytplayer_object_left""&gt;" &amp; _ "&lt;param name=""movie"" value=""https://www.youtube.com/v/UASyS-jUKKI?version=3&amp;feature=player_embedded&amp;controls=0&amp;enablejsapi=1&amp;showinfo=0&amp;iv_load_policy=3&amp;playerapiid=ytplayer_left""&gt;" &amp; _ "&lt;param name=""allowfullscreen"" value=""true""&gt;" &amp; _ "&lt;param name=""allowscriptaccess"" value=""always""&gt;" &amp; _ "&lt;embed src=""https://www.youtube.com/v/UASyS-jUKKI?version=3&amp;feature=player_embedded&amp;controls=0&amp;enablejsapi=1&amp;showinfo=0&amp;iv_load_policy=3&amp;playerapiid=ytplayer_left"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" allowscriptaccess=""always"" width=""425"" height=""344"" id=""ytplayer_left""&gt;&lt;/object&gt;" Table1.Rows(0).Cells(2).Text = "&lt;object style=""height: 390px; width: 640px"" id=""ytplayer_object_right""&gt;" &amp; _ "&lt;param name=""movie"" value=""https://www.youtube.com/v/uasys-jukki?version=3&amp;feature=player_embedded&amp;controls=0&amp;enablejsapi=1&amp;showinfo=0&amp;iv_load_policy=3&amp;playerapiid=ytplayer_right""&gt;" &amp; _ "&lt;param name=""allowfullscreen"" value=""true""&gt;" &amp; _ "&lt;param name=""allowscriptaccess"" value=""always""&gt;" &amp; _ "&lt;embed src=""https://www.youtube.com/v/uasys-jukki?version=3&amp;feature=player_embedded&amp;controls=0&amp;enablejsapi=1&amp;showinfo=0&amp;iv_load_policy=3&amp;playerapiid=ytplayer_right"" type=""application/x-shockwave-flash"" allowfullscreen=""true"" allowscriptaccess=""always"" width=""425"" height=""344"" id=""ytplayer_right""&gt;&lt;/object&gt;" </code></pre> <p>I've made sure that the IDs are different on both, and the onYouTubePlayerReady(id) is correctly called for both (returning the 'ytplayer_left' and 'ytplayer_right'). However, I can't get each video as a different javascript variable so I can play/pause them independently. </p> <p>This is the code I've tried:</p> <pre><code>var vid_left; var vid_right; function onYouTubePlayerReady(id) { alert(id); if (id = 'ytplayer_right') { vid_right = document.getelementbyId(id); alert(vid_right); } if(id = 'ytplayer_left') { vid_left = document.getelementbyId(id); alert(vid_left); } </code></pre> <p>Any help? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload