Borderless Video Player?

Hello all,

I was wondering, is there a way to make the current video player border-less?
Currently, the default video player looks like:

What I want it to look like:

I see in the docs there is a “border” property for the “YouTubeVideo” object, but it doesn’t give any sort of use case of how to use it, or what exactly it denotes…

Is this being displayed in an alert currently?

Yes. It’s being done like this.

alert(YouTubeVideo(youtube_id='5wb5HWVh6Fs', autoplay=True), large=True)

When I create a YouTubeVideo in an alert, I don’t get a border. Can you possibly share a clone link so we can take a closer look?

When you say border, are you talking about the padding between the player and the alert container (and possibly the OK button) ?

Maybe it’s my eyes (I’m 89 you know), but I can’t see a border around the player itself in your two pics.

1 Like

Sorry, I guess I must be using the wrong word. In my mind there are two rectangles. The rectangle that contains the video, and then the encompassing rectangle that also contains the “OK”. I just want to show the inner rectangle showing that contains the video. Does that make sense? I’ll try and illustrate:

Here is the current state:

This is what I want, except imagine the encompassing rectangle highlighted in red is completely gone:

Hmm…you can make it look at least equal all the way around by removing the buttons (buttons=[]) but I can’t work out the CSS required to remove the padding, sorry.

If I get a moment of inspiration I’ll post.

Something like

    alert(YouTubeVideo(youtube_id='5wb5HWVh6Fs', 
                       autoplay=True, 
                       spacing_above=None,
                       spacing_below=None
                      ), 
          large=True, buttons=[])


and in theme.css

either find the .modal-body and replace the padding to be zero

.modal-body {
  padding: 0;
  font-size: 16px;
  color: #747474;
}

or just add to the bottom of theme.css:

.modal-body {
  padding: 0;
}
2 Likes

also - if this is still the rickroll maybe dismissable=False for the alert?

or with dismissable=True and inside a while True loop… :thinking:

2 Likes

That’s the line that did it for me :

.modal-body {
  padding: 0 !important;
}

https://anvil.works/build#clone:5JSOZ4HDFMNMDDSG=W6GUQXNT7L44ZQ26USYUJ6NR

5 Likes

Thanks everybody :slight_smile: Really appreciate it!

1 Like