Skip to content

Commit afd90f1

Browse files
author
evgeny-nadymov
committed
Support video rotation for Firefox p2p calls
1 parent d994186 commit afd90f1

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/Calls/P2P/P2PSdpBuilder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ export function p2pParseSdp(sdp) {
237237
return info;
238238
}
239239

240-
function isFirefox() {
240+
export function isFirefox() {
241241
return navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
242242
}
243243

src/Components/Calls/CallPanel.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import MenuIcon from '../../Assets/Icons/More';
2323
import MicIcon from '../../Assets/Icons/Mic';
2424
import MicOffIcon from '../../Assets/Icons/MicOff';
2525
import { closeCallPanel } from '../../Actions/Call';
26+
import { isFirefox } from '../../Calls/P2P/P2PSdpBuilder';
2627
import { p2pGetCallStatus, p2pIsCallReady } from '../../Calls/Utils';
2728
import { getUserFullName } from '../../Utils/User';
2829
import { stopPropagation } from '../../Utils/Message';
@@ -31,6 +32,8 @@ import LStore from '../../Stores/LocalizationStore';
3132
import UserStore from '../../Stores/UserStore';
3233
import './CallPanel.css';
3334

35+
const SUPPORTS_ROTATION = true;
36+
3437
class CallPanel extends React.Component {
3538
constructor(props) {
3639
super(props);
@@ -255,6 +258,13 @@ class CallPanel extends React.Component {
255258

256259
let screenSharing = currentCall && Boolean(currentCall.screenStream);
257260

261+
let outputVideoStyle = null;
262+
if (SUPPORTS_ROTATION && outputMediaState && isFirefox()) {
263+
outputVideoStyle = {
264+
transform: `rotate(${outputMediaState.videoRotation}deg)`
265+
};
266+
}
267+
258268
return (
259269
<div className={classNames('group-call-panel', { 'full-screen': fullScreen })} ref={this.callPanelRef}>
260270
<div className='group-call-panel-header'>
@@ -330,7 +340,7 @@ class CallPanel extends React.Component {
330340
</Popover>
331341
</div>
332342
<div className='call-panel-content scrollbars-hidden' onDoubleClick={this.handleFullScreen}>
333-
<video id='call-output-video' className={outputMediaState && outputMediaState.videoState === 'active' ? 'call-video-active' : 'call-video-inactive'} autoPlay={true} muted={false}/>
343+
<video id='call-output-video' style={outputVideoStyle} className={outputMediaState && outputMediaState.videoState === 'active' ? 'call-video-active' : 'call-video-inactive'} autoPlay={true} muted={false}/>
334344
<video id='call-input-video' className={inputMediaState && inputMediaState.videoState === 'active' ? 'call-video-active' : 'call-video-inactive'} autoPlay={true} muted={true}/>
335345
</div>
336346
{ outputMediaState && outputMediaState.muted && (

0 commit comments

Comments
 (0)