Skip to content

Commit 3aee6e5

Browse files
committed
feat: video layout
1 parent e414aaa commit 3aee6e5

File tree

2 files changed

+31
-4
lines changed

2 files changed

+31
-4
lines changed

src/components/stateless/SmartVideoPlayer/index.jsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ const SmartVideoPlayer = ({
142142

143143
const name = typeof err?.name === 'string' ? err.name : 'PlayError'
144144
const message = typeof err?.message === 'string' ? err.message : ''
145+
146+
// Common & harmless: play() interrupted by pause() (e.g. IO lazy-play or rapid user toggles)
147+
if (
148+
name === 'AbortError' ||
149+
/interrupted by a call to pause\(\)/i.test(message) ||
150+
/The play\(\) request was interrupted/i.test(message)
151+
) {
152+
return
153+
}
154+
145155
setPlayError(message ? `无法播放:${name} - ${message}` : `无法播放:${name}`)
146156
})
147157
}, [])

src/pages/video/index.module.css

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.page {
2-
padding: 24px;
2+
padding: 16px;
33
width: 100%;
44
display: flex;
55
justify-content: center;
@@ -8,10 +8,8 @@
88

99
.card {
1010
width: 100%;
11-
max-width: 40vw;
12-
border: 1px solid rgba(0, 0, 0, 0.08);
11+
max-width: 960px;
1312
border-radius: 16px;
14-
background: #fff;
1513
overflow: hidden;
1614
}
1715

@@ -45,6 +43,25 @@
4543
white-space: nowrap;
4644
}
4745

46+
@media (max-width: 640px) {
47+
.page {
48+
padding: 0;
49+
}
50+
51+
.card {
52+
max-width: 100%;
53+
border-radius: 0;
54+
}
55+
56+
.header {
57+
padding: 12px 12px 10px;
58+
}
59+
60+
.subTitle {
61+
max-width: 70vw;
62+
}
63+
}
64+
4865
.actions {
4966
display: flex;
5067
flex-wrap: wrap;

0 commit comments

Comments
 (0)