Skip to content
Snippets Groups Projects
Unverified Commit ade1401c authored by Anton Georgiev's avatar Anton Georgiev Committed by GitHub
Browse files

Merge pull request #11845 from ramonlsouza/mobile-dropdown-fix

Fix mobile video dropdown
parents 7b2ee5f0 369aa508
No related branches found
No related tags found
No related merge requests found
...@@ -147,14 +147,6 @@ ...@@ -147,14 +147,6 @@
} }
} }
@include mq($small-only) {
button {
/* should be placed after .dropdownContent
90vh: .dropdownContent height, 85px: navbar, 5rem: actions bar) */
top: calc(90vh - 85px - 5rem);
height: 10vh;
}
}
@include mq($landscape) { @include mq($landscape) {
button { button {
width: calc(100vw - 4rem); width: calc(100vw - 4rem);
...@@ -205,8 +197,7 @@ ...@@ -205,8 +197,7 @@
} }
@include mq($small-only) { @include mq($small-only) {
// use 90% of available height (85px: navbar, 5rem: actions bar) height: 90%;
height: calc(90vh - 85px - 5rem);
width: 100vw; width: 100vw;
} }
} }
......
...@@ -22,6 +22,7 @@ import { ...@@ -22,6 +22,7 @@ import {
subscribeToStreamStateChange, subscribeToStreamStateChange,
unsubscribeFromStreamStateChange, unsubscribeFromStreamStateChange,
} from '/imports/ui/services/bbb-webrtc-sfu/stream-state-service'; } from '/imports/ui/services/bbb-webrtc-sfu/stream-state-service';
import deviceInfo from '/imports/utils/deviceInfo';
const ALLOW_FULLSCREEN = Meteor.settings.public.app.allowFullscreen; const ALLOW_FULLSCREEN = Meteor.settings.public.app.allowFullscreen;
...@@ -41,6 +42,7 @@ class VideoListItem extends Component { ...@@ -41,6 +42,7 @@ class VideoListItem extends Component {
this.setVideoIsReady = this.setVideoIsReady.bind(this); this.setVideoIsReady = this.setVideoIsReady.bind(this);
this.onFullscreenChange = this.onFullscreenChange.bind(this); this.onFullscreenChange = this.onFullscreenChange.bind(this);
this.onStreamStateChange = this.onStreamStateChange.bind(this); this.onStreamStateChange = this.onStreamStateChange.bind(this);
this.updateOrientation = this.updateOrientation.bind(this);
} }
onStreamStateChange(e) { onStreamStateChange(e) {
...@@ -69,6 +71,7 @@ class VideoListItem extends Component { ...@@ -69,6 +71,7 @@ class VideoListItem extends Component {
this.videoTag.addEventListener('loadeddata', this.setVideoIsReady); this.videoTag.addEventListener('loadeddata', this.setVideoIsReady);
this.videoContainer.addEventListener('fullscreenchange', this.onFullscreenChange); this.videoContainer.addEventListener('fullscreenchange', this.onFullscreenChange);
subscribeToStreamStateChange(cameraId, this.onStreamStateChange); subscribeToStreamStateChange(cameraId, this.onStreamStateChange);
window.addEventListener('resize', this.updateOrientation);
} }
componentDidUpdate() { componentDidUpdate() {
...@@ -99,6 +102,7 @@ class VideoListItem extends Component { ...@@ -99,6 +102,7 @@ class VideoListItem extends Component {
this.videoContainer.removeEventListener('fullscreenchange', this.onFullscreenChange); this.videoContainer.removeEventListener('fullscreenchange', this.onFullscreenChange);
unsubscribeFromStreamStateChange(cameraId, this.onStreamStateChange); unsubscribeFromStreamStateChange(cameraId, this.onStreamStateChange);
onVideoItemUnmount(cameraId); onVideoItemUnmount(cameraId);
window.removeEventListener('resize', this.updateOrientation);
} }
onFullscreenChange() { onFullscreenChange() {
...@@ -143,6 +147,10 @@ class VideoListItem extends Component { ...@@ -143,6 +147,10 @@ class VideoListItem extends Component {
]); ]);
} }
updateOrientation() {
this.setState({ isPortrait: deviceInfo.isPortrait() });
}
renderFullscreenButton() { renderFullscreenButton() {
const { name } = this.props; const { name } = this.props;
const { isFullscreen } = this.state; const { isFullscreen } = this.state;
...@@ -165,6 +173,7 @@ class VideoListItem extends Component { ...@@ -165,6 +173,7 @@ class VideoListItem extends Component {
videoIsReady, videoIsReady,
isFullscreen, isFullscreen,
isStreamHealthy, isStreamHealthy,
isPortrait,
} = this.state; } = this.state;
const { const {
name, name,
...@@ -179,6 +188,8 @@ class VideoListItem extends Component { ...@@ -179,6 +188,8 @@ class VideoListItem extends Component {
const shouldRenderReconnect = !isStreamHealthy && videoIsReady; const shouldRenderReconnect = !isStreamHealthy && videoIsReady;
const { isFirefox } = browserInfo; const { isFirefox } = browserInfo;
const { isPhone } = deviceInfo;
const isTethered = isPhone && isPortrait;
return ( return (
<div <div
...@@ -230,7 +241,7 @@ class VideoListItem extends Component { ...@@ -230,7 +241,7 @@ class VideoListItem extends Component {
<div className={styles.info}> <div className={styles.info}>
{enableVideoMenu && availableActions.length >= 3 {enableVideoMenu && availableActions.length >= 3
? ( ? (
<Dropdown className={isFirefox ? styles.dropdownFireFox : styles.dropdown}> <Dropdown tethered={isTethered} placement="right bottom" className={isFirefox ? styles.dropdownFireFox : styles.dropdown}>
<DropdownTrigger className={styles.dropdownTrigger}> <DropdownTrigger className={styles.dropdownTrigger}>
<span>{name}</span> <span>{name}</span>
</DropdownTrigger> </DropdownTrigger>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment