The Problem
I’ve got a popup connected to a repeating group. I have a video visual element in the popup with dynamic youtube ID linked to the repeating group. All works well except when the video is started and the user closes the popup, the video keeps playing!
Solutions Tried:
I’ve been researching this a lot and Emmanuel had some good posts from 4 years ago about resetting the popup group data but I’ve tried that and it’s not working.
Someone else posted about creating a group with the type of content set to “video” but when I tried this there literally isn’t a “video” option for type of content.
Seeing the front end does not provide details on how things work in the back
As a general approach to display a video onto a popup from an rg these could be the steps to be taken:
set the popup to be of type text and not to be closed by pressing “esc” (this will give us control that the popup be closed via an action that we control)
also set a “close” icon (… like an “X”) and set an action to hide the popup when pressed … and prior to this one to reset the popup’s text
set the video element data source to be the parent group’s text (which is the popup’s text)
clicking the rg row should (1) reset the popup’s text (it is always a good practice to empty things first), (2) set the youtube id which at the end of the day is a text onto the popup’s text
now the user can press play on the video and the video will play …
and to close the popup the only way to do it would be to press “X” that resets the popup’s text and closes the popup
For the record, I love you. I spent hours trying to figure this out but didn’t venture too far down the conditional route because I was worried changing the Video ID via a conditional statement would rewrite to the database (it doesn’t). So the video stops playing now when the popup is exited and the original video ID is preserved.
Appreciate the thoughtful response. Turned out the conditional statement that @hacker posted worked the first time. I wanted to try the easier method first. Thanks!