How to expand rectangle with video content inside


#1

Hi (new)
I’m trying to build a video widget that will be over the GUI, it will have 3-5 video but at the start, it will focus on one only. I searched a lot for directions but didn’t find anything. I need to be able to do these things:

  1. I want to put 3-5 video’s inside a rectangle/widget in a vertical position.
  2. I want to be able to change the size by dragging one of the rectangle points without losing his aspect ratio. and the videos will also resize accordingly
  3. I want the rectangle to be drag and drop.
  4. There will be a button that will expand the rectangle and show all videos.

if you have any answer to one of the questions it will be great.

Thanks and sorry for DROPPING heavy requests


#2

You can do all of it but it’s going to be finicky, especially with enforcing the aspect ratio.

There’s a really good thread on how to resize widgets with a drag (Resize dynamic panel with drag), so I won’t do a whole lot of explaining about that here. The big difference is that, in this case, you only want to resize if the width is going to be divisible by 16 (assuming you’re using 16:9). The logic would look something like:
IF [[x % 16]] equals "0" then Set Size
You then would want to resize the videos by the percentage difference between their size and the container’s size.

One of the biggest problems with using the “Drag” event is that it’s pretty easy to drag the widget faster than it can run the logic so things get out of sync quickly.

There’s a lot going on with what you’re trying to do, so be prepared to tweak a lot to get it to work exactly right: Keep_Aspect_Ratio.rp (118.9 KB)


#3

Thanks for your help.