# Perspective iFrame Youtube video autostart

**URL:** <https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951>\
**Category:** Ignition\
**Created:** [June 18, 2021, 2:48pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951 "2021-06-18T14:48:18Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [June 18, 2021, 2:48pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/1 "2021-06-18T14:48:18Z")

</div>

Is there a way to have a youtube video autostart? I’ve added the “&autoplay=1” to the url, but with no luck. Nothing I seem to do is able to get the video to start automatically.

I do get the following error in the console, but I cannot seem to make heads or tails of it.

`15:46:18.926 [Browser Events Thread] INFO Perspective.Designer.BrowserConsole - Mixed Content: The page at 'https://www.youtube.com/embed/9Auq9mYxFEE' was loaded over HTTPS, but requested an insecure script 'chrome-extension://enhhojjnijigcajfphajepfemndkmdlo/cast_sender.js'. This request has been blocked; the content must be served over HTTPS.`

I’d settle for a way to programmatically click on the iFrame, but I’m assuming I cannot figure that one out either because it would be some sort of security hole.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 18, 2021, 4:38pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/2 "2021-06-18T16:38:12Z")

</div>

Oddly, I can get some videos to autoplay, but not others. I originally thought it might be a browser restriction on autoplaying content with sound, but amusingly this video seems to work fine with `autoplay=1`, even in a Perspective session:

> **[Tryit Editor v3.6](https://www.w3schools.com/html/tryit.asp?filename=tryhtml_youtubeiframe)**

---

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [June 18, 2021, 6:04pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/3 "2021-06-18T18:04:52Z")

</div>

Umm…So where do I go from here?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 18, 2021, 6:15pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/4 "2021-06-18T18:15:07Z")

</div>

I can’t really tell you. Some videos working but not others rules out browser restrictions, and the fact I can get Perspective videos to autoplay rules out something we’re not doing on our end. It looks like the discrepancy is on Youtube.

---

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [June 18, 2021, 6:31pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/5 "2021-06-18T18:31:27Z")

</div>

Ah ha… you need to have the start command on some of these videos…

link needs to have ?autoplay=1;start=0

---

<div class="post-metadata">

**Author:** ![djones](https://avatars.discourse-cdn.com/v4/letter/d/43a26b/32.png) [@djones](https://forum.inductiveautomation.com/u/djones)\
**Post date:** [June 19, 2021, 12:57am UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/7 "2021-06-19T00:57:27Z")

</div>

A little more information......Google updated their autoplay policy in 2018. There can be a variety of reasons why a video is not permitted to autoplay. Some videos will not permit themselves to be autoplayed with the sound on, so adding the &mute=1 flag solves that. Some do not allow to be autoplayed unless the start location is specified (use &start=0 to start at the beginning)

Here is the format I use to autoplay, start at 0, mute the sound, set the language to 0 and turn on closed captioning.

For reference, I use this on a digital sign in the office and lab. It rotates through a bunch of different sets of information:

- displays traditional information from the plant
- some images that are uploaded with pertinent information for the employees
- I am mixing in some other media to change keep people looking at the screen, such as local weather and now going out and grabbing the bbc or sky news and playing 30 sec or a minute of closed caption news.

[![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/9/598ee81a6f46c4a2ea6c1b385182c14458a345c4.jpeg "How these Aussie neighbours became billionaires by outsmarting the big banks | 60 Minutes Australia") ](https://www.youtube.com/watch?v=02D_aNS5NSc)

Here is the most recent autoplay policy for reference.

> **[Autoplay policy in Chrome - Chrome Developers](https://developer.chrome.com/blog/autoplay/)**
>
> Learn best practices for good user experiences with the new autoplay policies in Chrome.

---

<div class="post-metadata">

**Author:** ![tailfire](https://avatars.discourse-cdn.com/v4/letter/t/b5a626/32.png) [@tailfire](https://forum.inductiveautomation.com/u/tailfire)\
**Post date:** [March 24, 2022, 4:32pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/8 "2022-03-24T16:32:07Z")

</div>

Are you doing this on an RPi through Chromium?

---

<div class="post-metadata">

**Author:** ![emil\_dior](https://avatars.discourse-cdn.com/v4/letter/e/3bc359/32.png) [@emil\_dior](https://forum.inductiveautomation.com/u/emil_dior)\
**Post date:** [December 13, 2022, 4:35pm UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/9 "2022-12-13T16:35:10Z")

</div>

Since April 2018, Google made some changes to the Autoplay Policy. You not only need to add the autoplay=1 as a query param, but also add allow='autoplay' as an iframe's attribute

So while [embed youtube](http://net-informations.com/q/mis/youtube.html) video, you will have to do something like this:

`<iframe src="https://www.youtube.com/embed/VIDEO_ID?autoplay=1" allow='autoplay'></iframe>`

---

<div class="post-metadata">

**Author:** ![enrique\_de\_las\_fuent](https://avatars.discourse-cdn.com/v4/letter/e/e99b99/32.png) [@enrique\_de\_las\_fuent](https://forum.inductiveautomation.com/u/enrique_de_las_fuent)\
**Post date:** [November 15, 2024, 12:06am UTC](https://forum.inductiveautomation.com/t/perspective-iframe-youtube-video-autostart/47951/10 "2024-11-15T00:06:51Z")

</div>

Firefox auto plays IFrame, for Chrome I had to add the gateway to sites that are allowed to play sound even if the default behavior is sites can play sound.  
chrome settings/privacy and security/site settings/sound
