Answered

Way to import Youtube Playlist automatically?

  • 25 April 2021
  • 2 replies
  • 174 views

Userlevel 1

Hi I would like to import a youtube playlist into a board.  Is there a way to do this?  or would i need to use a greasemonkey script or the API to do this?  

 

If the API, any tips on relevant info to try would be appreciated.

icon

Best answer by Max Harper 26 April 2021, 03:23

View original

2 replies

Userlevel 7
Badge +5

@Constructive Realities 

I want this too.  

The ‘widget’ (what Miro calls all objects on a board) type that you’re looking for is called ‘Embed’. 

The API won’t be of any help at present. As the embed is read only.
 

 

 

The SDK will be your good friend though… as with it the embed widget is read and write.
You can create an embed widget with the SDK calling the create function, passing in the ‘embed object’ with youtube iframe embed html as a string for the html property of that object.

 
Here’s where to find the embed widget in the documentation. And the widgets.create function.


Example like this:  

miro.board.widgets.create({
type: 'EMBED',
x: 0,
y: 0,
scale: 1,
html: '<iframe width="560" height="315" src="https://www.youtube.com/embed/EN_du1DCgfw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
})

 


Video of it working.


Let me know if you’d like further guidance or support. 

I’ve been thinking of prototyping a plugin to help do this. Maybe we oughta collaborate on such a thing. 

 

Cheers
Max

Userlevel 1

@Max Harper  thanks for the detailed write up.  this is exactly what i was looking to understand.   I’ll have a block and review how this works and see if i can reproduce…  make it go. 

Thanks!

Reply