Skip to content

Commit c0cb1aa

Browse files
author
Prash
committed
fix(video): Fixed mirroring for user other than self
1 parent 25d8f62 commit c0cb1aa

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

src/client/ui-components/video-container/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class VideoContainer extends Component {
4545
}}
4646
disableMute={this.props.users[userId].disableMute}
4747
muted={this.props.users[userId].muted}
48+
mirror={this.props.users[userId].mirror}
4849
/>
4950
</Col>
5051
))}
@@ -81,7 +82,8 @@ function mapStateToProps (state, ownProps) {
8182
streamUrl: state.user ? state.user.streamUrl : null,
8283
socketId: state.user.socket.id,
8384
muted: true,
84-
disableMute: true
85+
disableMute: true,
86+
mirror: true
8587
}
8688
}
8789
}

src/client/ui-components/video/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.video {
22
width: 100%;
3+
}
4+
5+
.video-mirror {
36
-webkit-transform: scaleX(-1);
47
transform: scaleX(-1);
58
}

src/client/ui-components/video/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class VideoPlayer extends Component {
5858
</div>
5959
<video
6060
poster={getRandomAvatarUrl()}
61-
className='video'
61+
className={`video ${this.props.mirror ? 'video-mirror' : ''}`}
6262
ref={el => { this.videoRef = el }}
6363
muted={this.props.muted}
6464
onClick={this.props.onClick}
@@ -94,7 +94,8 @@ VideoPlayer.propTypes = {
9494
onLoadedMetadata: PropTypes.func,
9595
showDebugInfo: PropTypes.bool,
9696
metadata: PropTypes.any,
97-
disableMute: PropTypes.bool
97+
disableMute: PropTypes.bool,
98+
mirror: PropTypes.bool
9899
}
99100

100101
VideoPlayer.defaultProps = {
@@ -104,7 +105,8 @@ VideoPlayer.defaultProps = {
104105
autoPlay: true,
105106
muted: false,
106107
showDebugInfo: false,
107-
disableMute: false
108+
disableMute: false,
109+
mirror: false
108110
}
109111

110112
export default VideoPlayer

0 commit comments

Comments
 (0)