Forum Discussion
milankysel
Jul 07, 2022Copper Contributor
Dynamic embed code for youtube
How do I embed the latest posted video from a YouTube page (dynamic code)? any help please?
Noa-Arkenaar
Jul 07, 2022Copper Contributor
Hi,
To add a YouTube video you can use 3 different options to achieve this:
1. Add YouTube video to SharePoint Online Page: choose YouTube from the Webpart list when you edit a page. Copy the url or the embed code and paste this in the webpart parameters.
2. Host the video in Microsoft Streams and embed in SharePoint Online site: choose Stream from the Webpart list when you edit the page. Choose Share in Stream and use this to paste in the address parameter for the Webpart.
3. Use Embed Web Part to Add a Video to SharePoint Online: choose Embed from the Webpart list when you edit the page. Copy the Embed code from the YouTube video and paste it in the Embed Webpart.
To add a YouTube video you can use 3 different options to achieve this:
1. Add YouTube video to SharePoint Online Page: choose YouTube from the Webpart list when you edit a page. Copy the url or the embed code and paste this in the webpart parameters.
2. Host the video in Microsoft Streams and embed in SharePoint Online site: choose Stream from the Webpart list when you edit the page. Choose Share in Stream and use this to paste in the address parameter for the Webpart.
3. Use Embed Web Part to Add a Video to SharePoint Online: choose Embed from the Webpart list when you edit the page. Copy the Embed code from the YouTube video and paste it in the Embed Webpart.
milankysel
Jul 07, 2022Copper Contributor
This I understand. But it's still one specific video. I'm looking for a dynamic embed code which automatically uses always last added video on out youtube page.
- Noa-ArkenaarJul 07, 2022Copper Contributor
This is not specifically SharePoint related, but you can use the following embedded code and replace "YOUR_CHANNEL_NAME_HERE" with your channel.
<iframe width="600" height="340" src="https://www.youtube.com/embed?max-results=1&controls=0&showinfo=0&rel=0&listType=user_uploads&list=YOUR_CHANNEL_NAME_HERE" frameborder="0" allowfullscreen></iframe>- milankyselJul 07, 2022Copper ContributorIt's not working 😞 it says "This video is unavailable."
- Noa-ArkenaarJul 07, 2022Copper Contributor
milankysel could you share the code snippet you are using?