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?
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
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:
Set the Type of the popup to the Video data type.
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
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.
When popup is closed > reset group (popup). This should shut it off.
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)
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.
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”