This tutorial provides the steps to autoplay a YouTube video in a modal in Oxygen.
Step 1
In Oxygen editor, add a Modal component.
Add a Video component inside the Modal.
Tick “Manually Paste Iframe Code”.
Paste the YouTube video embed code.
Ex.:
<iframe width="560" height="315" src="https://www.youtube.com/embed/d0tU18Ybcvk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Add `?autoplay=1` after the video URL.
Ex.:
<iframe width="560" height="315" src="https://www.youtube.com/embed/d0tU18Ybcvk?autoplay=1" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
![](https://i2.wp.com/wpdevdesign.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-09-at-9.25.32-pm.png?fit=552%2C1024&ssl=1)
Make sure you set the Trigger for the modal.
That’s it!