mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
include FloatingPanel
for mobile
This commit is contained in:
parent
8d048698c3
commit
972a927555
@ -3,7 +3,7 @@ import React from "react"
|
|||||||
import * as antd from "antd"
|
import * as antd from "antd"
|
||||||
|
|
||||||
import Livestream from "../../models/livestream"
|
import Livestream from "../../models/livestream"
|
||||||
|
import { FloatingPanel } from "antd-mobile"
|
||||||
import { UserPreview, LiveChat } from "components"
|
import { UserPreview, LiveChat } from "components"
|
||||||
import { Icons } from "components/Icons"
|
import { Icons } from "components/Icons"
|
||||||
|
|
||||||
@ -14,6 +14,8 @@ import mpegts from "mpegts.js"
|
|||||||
import "plyr/dist/plyr.css"
|
import "plyr/dist/plyr.css"
|
||||||
import "./index.less"
|
import "./index.less"
|
||||||
|
|
||||||
|
const floatingPanelAnchors = [160, 72 + 119, window.innerHeight * 0.8]
|
||||||
|
|
||||||
export default class StreamViewer extends React.Component {
|
export default class StreamViewer extends React.Component {
|
||||||
state = {
|
state = {
|
||||||
isEnded: false,
|
isEnded: false,
|
||||||
@ -224,9 +226,14 @@ export default class StreamViewer extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
return <div className="stream">
|
return <div className="liveStream">
|
||||||
<video ref={this.videoPlayerRef} id="player" />
|
<video ref={this.videoPlayerRef} id="player" />
|
||||||
|
|
||||||
|
{
|
||||||
|
window.isMobile ?
|
||||||
|
<FloatingPanel anchors={floatingPanelAnchors}>
|
||||||
|
<UserPreview username={this.state.streamInfo?.username} />
|
||||||
|
</FloatingPanel> :
|
||||||
<div className="panel">
|
<div className="panel">
|
||||||
<div className="info">
|
<div className="info">
|
||||||
<UserPreview username={this.state.streamInfo?.username} />
|
<UserPreview username={this.state.streamInfo?.username} />
|
||||||
@ -242,6 +249,7 @@ export default class StreamViewer extends React.Component {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -15,7 +15,7 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.stream {
|
.liveStream {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user