Browse Source

Auto full-screen

master
Roderic Day 5 years ago
parent
commit
6ab778a63b
2 changed files with 15 additions and 1 deletions
  1. +6
    -0
      pico.css
  2. +9
    -1
      pico.js

+ 6
- 0
pico.css View File

} }
.media { .media {
grid-area: media; grid-area: media;
display: grid;
grid-template-rows: auto 1fr;
} }
#textbox { #textbox {
resize: none; resize: none;
resize: vertical; resize: vertical;
position: relative; position: relative;
} }
.videos.full-screen {
height: 100% !important;
resize: none;
}
.video-container { .video-container {
display: inline-block; display: inline-block;
position: relative; position: relative;

+ 9
- 1
pico.js View File

} }
const VideoOptions = { const VideoOptions = {
available: ['mirror', 'square', 'full-screen'], available: ['mirror', 'square', 'full-screen'],
anyFullScreen: () => {
for(const username of State.online) {
if(State.options[username].has('full-screen')) {
return 'full-screen'
}
}
return ''
},
getFor: (username) => { getFor: (username) => {
if(!State.options[username]) { if(!State.options[username]) {
State.options[username] = new Set(['mirror', 'square']) State.options[username] = new Set(['mirror', 'square'])
'mute' 'mute'
), ),
), ),
m('.videos',
m('.videos', {className: VideoOptions.anyFullScreen()},
Object.keys(State.streams).map((username) => Object.keys(State.streams).map((username) =>
m(Video, {key: username, username}) m(Video, {key: username, username})
), ),

Loading…
Cancel
Save