Possible to embed YouTube/Vimeo videos in a pop-up?

634
1
07-22-2020 08:45 AM
KieranClark
Occasional Contributor

I'm trying to figure out if it is possible to embed a YouTube video in a pop-up on a hosted feature layer. An iframe embed doesn't seem to work and the iframe snippet gets removed every time I go back to edit mode.

0 Kudos
1 Reply
KieranClark
Occasional Contributor

So I've figured out how to get a video embedded as per: How To: Embed a video in pop-ups in ArcGIS Online for a hosted feature service 

I've got a process to add the necessary iframe code and video source to my layers and it works on the map and even autoplays.

However...the audio now plays twice, as if a second instance of the video is playing in the background about half a second later. I would appreciate some guidance - I hope it's a simple setting or URL parameter that I have overlooked.

This is the map in question: https://subtelforum.com/cablemap/ 

And this is what the iframe bit looks like:

<iframe src="https://www.youtube.com/embed/PAwUKXMFCVg?rel=0&fs=1&autoplay=1&playsinline=0" width="316" height="178" frameborder="0"></iframe>

Edit:

Ok, change the iframe code to the following (basically just added mute=1) makes the video autoplay correctly, and without double audio.

<iframe src="https://www.youtube.com/embed/PAwUKXMFCVg?rel=0&fs=1&autoplay=1&mute=1&playsinline=0" width="316" height="178" frameborder="0"></iframe>

The only downside is this makes the user have to manually unmute the audio, but I'm not terribly concerned about that.

0 Kudos