# Allowing autoplay on Youtube videos in Webviewer?

**URL:** <https://community.thunkable.com/t/allowing-autoplay-on-youtube-videos-in-webviewer/2727810>\
**Category:** Questions about Thunkable X\
**Tags:** webviewer, youtube\
**Created:** [November 28, 2023, 5:47pm UTC](https://community.thunkable.com/t/allowing-autoplay-on-youtube-videos-in-webviewer/2727810 "2023-11-28T17:47:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![devoslucas3yw](https://avatars.discourse-cdn.com/v4/letter/d/ecd19e/32.png) [@devoslucas3yw](https://community.thunkable.com/u/devoslucas3yw)\
**Post date:** [November 28, 2023, 5:47pm UTC](https://community.thunkable.com/t/allowing-autoplay-on-youtube-videos-in-webviewer/2727810/1 "2023-11-28T17:47:33Z")

</div>

Hello !

Thanks to the webviewer element, I can display Youtube videos in my app. Theoretically, they should also be played automatically as I added `?autoplay=1` at the end of the URL.

However, when previewing the app on Google Chrome, the video doesn’t play automatically… Upon further investigation, Google Chrome doesn’t allow the autoplay (unless the video is muted). One way to resolve the issue is apparently to add `allow='autoplay'` as an iframe’s attribute.

The webviewer being basically an iframe, is there a way to add this attribute ? If not, is there a simple solution to allow the autoplay of a Youtube video ?

Thanks in advance ! 🙂

 ![thunkable_autoplay](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/9/1925c9344cc619025a7726ce9b530be6e9121ab6.png)

---

<div class="post-metadata">

**Author:** ![matt\_conroy](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/matt_conroy/32/150843_2.png) [@matt\_conroy](https://community.thunkable.com/u/matt_conroy)\
**Post date:** [December 11, 2023, 4:11pm UTC](https://community.thunkable.com/t/allowing-autoplay-on-youtube-videos-in-webviewer/2727810/2 "2023-12-11T16:11:13Z")

</div>

It looks like YouTube has an option for an embedded IFrame player API. You could try adding this code into your Web Viewer component and seeing if that works for the autoplay issue.

> **[YouTube Player API Reference for iframe Embeds  |  YouTube IFrame...](https://developers.google.com/youtube/iframe_api_reference)**
>
> Embed a YouTube player in your application.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/f/0f59f292712368bce16ff80133ae10de8a6f27e8.png) [@system](https://community.thunkable.com/u/system)\
**Post date:** [March 10, 2024, 4:12pm UTC](https://community.thunkable.com/t/allowing-autoplay-on-youtube-videos-in-webviewer/2727810/3 "2024-03-10T16:12:11Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
