29.12.2021, 16:30
Hallo zusammen,
ich möchte auf einer Wordpress Seite 2 Youtube Videos über javascript einbinden. Am Ende erhalte ich nur eins. Woran liegt das bzw. was muss ich ändern? Entschuldigt bin noch Anfänger!
----------------------------------------------
1. Video
----------------------------------------------
<div class="responsive-container"><div id="player"></div></div> <script>var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: 'S4cZjaXmuzE',
});
}
function setCurrentTime(slideNum) {
var object = [ 0, 133, 193 ];
player.seekTo(object[slideNum]);
}</script>
----------------------------------------------
2. Video
----------------------------------------------
<div class="responsive-container"><div id="player"></div></div> <script>var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: 't1UlWeeZE6A',
});
}
function setCurrentTime(slideNum) {
var object = [ 0, 133, 193 ];
player.seekTo(object[slideNum]);
}</script>
ich möchte auf einer Wordpress Seite 2 Youtube Videos über javascript einbinden. Am Ende erhalte ich nur eins. Woran liegt das bzw. was muss ich ändern? Entschuldigt bin noch Anfänger!
----------------------------------------------
1. Video
----------------------------------------------
<div class="responsive-container"><div id="player"></div></div> <script>var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: 'S4cZjaXmuzE',
});
}
function setCurrentTime(slideNum) {
var object = [ 0, 133, 193 ];
player.seekTo(object[slideNum]);
}</script>
----------------------------------------------
2. Video
----------------------------------------------
<div class="responsive-container"><div id="player"></div></div> <script>var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
videoId: 't1UlWeeZE6A',
});
}
function setCurrentTime(slideNum) {
var object = [ 0, 133, 193 ];
player.seekTo(object[slideNum]);
}</script>