Creating a video in a popup

I need to insert a video in a popup, and after the user exits the popup by clicking outside of it, the video needs to stop.

Any help on how to do it please?
Thanks!
Dan

Set the video source to be the popup’s data…

Then just reset the popup’s data when the popup is closed.

Hi @dmintz2

You can try that:

  • Add a video element inside the popup.
  • Create a custom state (e.g., “videoPlaying”) for the popup with a default value of empty
  • Set the video’s id to be conditional based on the custom state (play when “videoPlaying” is the video ID and pause when empty).
  • When the popup is opened, set the custom state “videoPlaying” to the video id.
  • Create a workflow that detects when the popup is closed (e.g., by clicking outside). In this workflow, make empty the custom state “videoPlaying”

Best,

Thank you!!!

How do I do these 2 please?:

  • Set the video’s id to be conditional based on the custom state (play when “videoPlaying” is the video ID and pause when empty).
  • When the popup is opened, set the custom state “videoPlaying” to the video id.

Why make it so complicated? Just do what I suggested… it’s much simpler.

1 Like

I do not know how to do what you suggested

how do I do what you suggested please?

Like I said…

Set the video source to be the data of the popup.

Then wen the popup is closed just clear the popup’s data (so the video element no longer has a video to play).

It’s simple.

Here’s an example:

Video Popup (bubbleapps.io)

2 Likes


what “Data to display” should I choose?
I do not have the option like in your example of “Current Cell’s Video”

Thanks for the help!!!

Whatever contains the reference to the video you’re trying to play.


so this is the video I am trying to show, but as you can see bubble is asking for more paramerts for this video and I do not know what to do.

Thanks again

What content type is your popup?

The VIDEO, not the player element. You want the video that you’re going to configure the player to play.

1 Like

but i dont have the video itself listed in the list of “Data to Display”.
I cannot find a way to reference the video.


I am not sure what you mean by “content type”.
it is just a regular popup in which I placed in it a videojs player

I am not sure what you mean by “content type”.

You need to set a content type for you popup if you want to send data to it.

I cannot find a way to reference the video.

So where is the video coming from?


how come there’s no video content type to choose from the list here for the popup?

Do you have a custom datatype of Video in your app? (Obviously you don’t… but that’s irrelevant)…

The content type just needs to be whatever data you’re using to refer to the video. That obviously depends where the reference to the video is in your app.

ok I fixed most things and created a video type and uploaded a video to that and did use your workflows.
works fine, but the sound of the video continues to play in the background ever after the popup is closed.
Drives me nuts