Re: Embedding YouTube videos on Product pages
Perplexed by the difficulties people seem to face with the issue of embedding videos, I have posted my own long-used solution on GitHub.
Here is a link direct to the readme:
https://github.com/torvista/Zen_Cart...ube_readme.txt
Any problems: post in GitHub.
Re: Embedding YouTube videos on Product pages
@torvista
Thanks for the script. I put it into my site correctly and it is working for me.
However do you know how to modify the player to accept a Playlist instead of a single video?
Thanks
Re: Embedding YouTube videos on Product pages
As far as I am aware if you navigate from the youtube video owner mainpage and choose playlist to get to the video, the v= link will be of the playlist instead of a single video, so use that.
Re: Embedding YouTube videos on Product pages
Thanks for replying .
I dont think I understand where to edit what you mentioned.
I tried to follow the instructions here:
https://developers.google.com/youtube/player_parameters
change
https://www.youtube.com/embed/VIDEO_ID
to
https://www.youtube.com/embed?listTy...st=PLAYLIST_ID
By editing your script youtube_tn.js
The line
iframe.setAttribute("src", "//www.youtube.com/embed/"
to
iframe.setAttribute("src", "//www.youtube.com/embed?listType=playlist&list="
But that did not work for me.
Re: Embedding YouTube videos on Product pages
Sorry, it was too early in the morning....so after morning chores:
Single video:
Code:
<div class="youtube-container">
<p>Cat Video</p>
<div class="youtube-player" data-yt_id="abc123abc123">
</div>
</div>
Video as part of playlist:
Code:
<div class="youtube-container">
<p>Cat Videos - Playlist</p>
<div class="youtube-player" data-yt_id="abc123abc123" data-yt_params="list=xyz123xyz123xyz123xyz123xyz123xyz123">
</div>
</div>