Video Plays based on Date

I want to make a list of videos to play from YouTube based on date.

I am trying to figure out how to go about creating this. I created a new Data Type and created a date field and video link field but have no clue how to get it to play in the video.

Does anyone know if this is possible and if so what would be the best way to go about it?

Thanks

Scott

Hey Scott,

Here’s one way…

In the video element, there’s a field to enter in the video ID. So, not the whole link. In YouTube, it’s the last part of the URL. E.g. The ID for https://www.youtube.com/watch?v=Y5G4YFqv5nw&t=7s is just Y5G4YFqv5nw&t=7s. This is what you’d enter in that ID field.

If your Video data type is something like this…

Video (type)

  • Date (date)
  • Title (text)
  • ID (text)

Then you could dynamically change which video is playing by searching for the video with today’s date, and ultimately navigating to its ID field. Now, because a date value in Bubble saves a date and time, you need to extract the date so that you’re not limited to a full date and time match. Here’s what your expression could look like…

Search for Videos :filtered :first item’s ID, where the filter is an advanced filter and that advanced filter is This Video’s Date :extract date is current date/time :extract date

Check it out:

is-2017-10-15-18-53-06-399

This is without knowing much more about your data and page structures, but hopefully this helps move you forward!


Gaby | Coaching Bubble
Private coaching, courses, and tons of free resources

2 Likes

Thanks for your reply. I noticed that the only time the ID worked is if I add the “watch?v” part.

I will take in everything else you said and try it.

Thanks again!!!

Scott

I think I got it to work!!!

Thank you!

Will see if the video automatically changes on 10-17. :slight_smile:

Scott

1 Like

Gaby.

I noticed that when I open this pop up it does exactly what you showed, but the video audio is still playing after I close out of the pop up.

Is there something I need to add to make the video stop playing in the background?

Thanks

Scott

Ah yes, you’ll have to reset the popup. When the popup is closed > reset group: popup.

However, there’s a chance that because the source of the video is not tied to the popup itself, it won’t stop the video. So, here’s what you’d need to do:

  1. Set the Type of the popup to the Video data type.
  2. In the workflow that shows the popup, add another action “display data” - element is popup and data to display is the same search you currently have in your ID field (but without the ID). So Data to Display = Search for Videos :filtered :first item
  3. By doing #2, you’re sending that specific Video record to the popup and the popup is now acting a source for the video record. Now, in the ID field in the video element, change it to “Parent Group’s Video ID”. Now, the video element is tied to the popup.
  4. When popup is closed > reset group (popup). This should shut it off.

Been trying this. Guess I am missing something. It still plays.

For some reason I am NOT getting the “Parent Group’s Video ID”

hmmm

Scott

Could you share some screenshots? or a link to your editor?

How do I get you a link to my editor? New to me.

My bad - just copy the URL in your address bar when the editor is open. Doesn’t matter what section of the editor you’re on. Also, make sure that the app is not private (Settings > General > Application Rights)

Is it for the shot of the day popup?

yes it is

I will be away from computer for a few hours. Is it safe to leave non-private?

Ok, check out the changes I made. In the workflow that opens the popup, I added the “Display Data” action. That’s where the search is performed. It sets the source of the popup to the found ShotDay.

The source of the popup is left blank in the property editor for the element itself because you’re setting the source via the Display Data action.

The value of the ID field is the “Parent Group’s ShotDay ID”, which is the Popup source ID, which is set via the workflow.

Check it out, let me know. You can put it back to private.

Thank you!

I tried it and it still plays the audio after closing the popup.

Now I am wondering if it is some sort of cache issue??

Can you share a screenshot of the action that resets the popup or open up access again?

Opened it back up.

I don’t think I have that action on there yet. I’m going to try it now.

I’ll let you try it first then. Yeah, in the workflow that hides the popup, add the “reset group” action. The group to reset is the popup. Keep in mind that if you have allowed for the popup to be closed by simply clicking outside of it, you should reset data off of the event “When a popup is closed”