瀏覽代碼

Auto full-screen

master
Roderic Day 5 年之前
父節點
當前提交
6ab778a63b
共有 2 個檔案被更改,包括 15 行新增1 行删除
  1. +6
    -0
      pico.css
  2. +9
    -1
      pico.js

+ 6
- 0
pico.css 查看文件

@@ -46,6 +46,8 @@ body {
}
.media {
grid-area: media;
display: grid;
grid-template-rows: auto 1fr;
}
#textbox {
resize: none;
@@ -70,6 +72,10 @@ body {
resize: vertical;
position: relative;
}
.videos.full-screen {
height: 100% !important;
resize: none;
}
.video-container {
display: inline-block;
position: relative;

+ 9
- 1
pico.js 查看文件

@@ -244,6 +244,14 @@ const TextBox = {
}
const VideoOptions = {
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) => {
if(!State.options[username]) {
State.options[username] = new Set(['mirror', 'square'])
@@ -324,7 +332,7 @@ const Media = {
'mute'
),
),
m('.videos',
m('.videos', {className: VideoOptions.anyFullScreen()},
Object.keys(State.streams).map((username) =>
m(Video, {key: username, username})
),

Loading…
取消
儲存