Video z-index workaround for Safari

When the Safari browser puts a webcam video full-screen and then
returns, the z-index of the video was higher than the buttons and
controls normally overlaid on top of it.

Add a z-index:1 to the video controls to keep them on top after
returning from full screen. Similar: for popped-out draggable videos,
adding a z-index:1 allows the video to correctly sit on top of docked
videos without the docked video controls (zi:1) rendering above the
popped-out video when you overlap them.

Note: the z-index:1 is applied to popped-out and video controls, any
other combination (e.g. 1 for popped-out and 2 for controls) caused
controls of docked videos to render on top of popped-out ones when they
overlapped.
This commit is contained in:
Noah 2024-06-12 22:49:30 -07:00
parent b011e36ddf
commit 147315fee2
3 changed files with 10 additions and 13 deletions

View File

@ -593,7 +593,7 @@ func (s *Server) OnMute(sub *Subscriber, msg messages.Message, mute bool) {
// OnBlock is a user placing a hard block (hide from) another user.
func (s *Server) OnBlock(sub *Subscriber, msg messages.Message) {
log.Info("%s blocks %s: %v", sub.Username, msg.Username)
log.Info("%s blocks %s", sub.Username, msg.Username)
// If the subject of the block is an admin, return an error.
if other, err := s.GetSubscriber(msg.Username); err == nil && other.IsAdmin() {

View File

@ -38,12 +38,6 @@ func (f flags) Check(video int) error {
return errors.New("Muted expected NOT to be set")
}
if video&messages.VideoFlagIsTalking == messages.VideoFlagIsTalking && !f.IsTalking {
return errors.New("IsTalking expected to be set")
} else if video&messages.VideoFlagIsTalking != messages.VideoFlagIsTalking && f.IsTalking {
return errors.New("IsTalking expected NOT to be set")
}
if video&messages.VideoFlagMutualRequired == messages.VideoFlagMutualRequired && !f.MutualRequired {
return errors.New("MutualRequired expected to be set")
} else if video&messages.VideoFlagMutualRequired != messages.VideoFlagMutualRequired && f.MutualRequired {
@ -217,14 +211,13 @@ func TestVideoFlagMutation(t *testing.T) {
},
{
Mutate: func(v int) int {
return v | messages.VideoFlagOnlyVIP | messages.VideoFlagNSFW | messages.VideoFlagIsTalking
return v | messages.VideoFlagOnlyVIP | messages.VideoFlagNSFW
},
Expect: flags{
Active: true,
Muted: true,
OnlyVIP: true,
NSFW: true,
IsTalking: true,
},
},
}

View File

@ -250,6 +250,7 @@ div.feed.popped-out {
top: 0;
left: 0;
resize: none;
z-index: 1; /* work around Safari video being on top when return from fullscreen */
}
.video-feeds.x1 > .feed {
@ -285,12 +286,14 @@ div.feed.popped-out {
position: absolute;
left: 4px;
bottom: 4px;
z-index: 1; /* work around Safari video being on top when return from fullscreen */
}
.feed > .close {
position: absolute;
right: 4px;
top: 0;
z-index: 1; /* work around Safari video being on top when return from fullscreen */
}
.feed > .caption {
@ -301,6 +304,7 @@ div.feed.popped-out {
left: 4px;
font-size: small;
padding: 2px 4px;
z-index: 1; /* work around Safari video being on top when return from fullscreen */
}
/* YouTube embeds */