Reputation: 960
I'm trying to embed a youtube playlist with a sidebar to my html page.
The playlist itself can be embedded by this html code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/videoseries?list=PLMC9KNkIncKtPzgY-5rmhvj7fax8fdxoj" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="1"/>
This displays the playlist, but without a sidebar. So I now want to add a sidebar next to the youtube playlist display.
So the final view should be something like this:
The sidebar items should be the thumbnail images of the next videos. You should be able to scroll/navigate to the next/previous videos in the playlist that aren't displayed. And when you click on the sidebar items the displayed video should be updated to the clicked video and the sidebar should updated to the next available videos.
On youtube playlist sidebars are displayed like this:
So we would like an alteration of that sidebar with only the image thumbnails. So a 'cleaner' look of the youtube sidebar.
Note: The solution should only use html/css/javascript.
These 2 questions have asked the same, but these are from to long ago and both the iframe and plugin solution don't seem work anymore.:
Edit:
The example in the answer seems to be outdated, here a functional version. (Full credits to @Skyrocker of course)
Upvotes: 7
Views: 18052
Reputation: 1962
You could YouTube Data API to embed a YouTube playlist with a sidebar but for that you have to do a lot of stuff. You would have to create a Google Developer account so that you get access to that API. Then you could create your project and create API and modify it according to your needs. And after you have made all the changes enable the API Services for YouTube and you are good to go.
Upvotes: 0
Reputation: 1049
TL;DR: you'll have to use official Google Youtube API
Unfortunately it's impossible to use the same "easy" approach, like the one that you use with a iframe
embedded Youtube. To be able to customize the look of the playlist you need to do a few preparation steps:
Then, after doing all from this list, see the codepen example how to orchestrate this. A few requirements:
Updates:
Indeed, you were right, those methods can be invoked without auth.
Here is your upgraded version of the list
Upvotes: 14
Reputation: 13
Implement divs of main page and sidebar, the way you embed video anywhere in the page, add it to the sidebar div, no trouble.
Upvotes: -6