mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
commit
4175dcd102
@ -31,24 +31,28 @@ module.exports = React.createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
if (!this.state.incomingCall || !this.state.incomingCall.roomId) {
|
|
||||||
return (
|
// NB: This block MUST have a "key" so React doesn't clobber the elements
|
||||||
<div>
|
// between in-call / not-in-call.
|
||||||
<audio ref="ringAudio" loop>
|
var audioBlock = (
|
||||||
|
<audio ref="ringAudio" key="voip_ring_audio" loop>
|
||||||
<source src="media/ring.ogg" type="audio/ogg" />
|
<source src="media/ring.ogg" type="audio/ogg" />
|
||||||
<source src="media/ring.mp3" type="audio/mpeg" />
|
<source src="media/ring.mp3" type="audio/mpeg" />
|
||||||
</audio>
|
</audio>
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!this.state.incomingCall || !this.state.incomingCall.roomId) {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{audioBlock}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
var caller = MatrixClientPeg.get().getRoom(this.state.incomingCall.roomId).name;
|
var caller = MatrixClientPeg.get().getRoom(this.state.incomingCall.roomId).name;
|
||||||
return (
|
return (
|
||||||
<div className="mx_IncomingCallBox">
|
<div className="mx_IncomingCallBox">
|
||||||
|
{audioBlock}
|
||||||
<img className="mx_IncomingCallBox_chevron" src="img/chevron-left.png" width="9" height="16" />
|
<img className="mx_IncomingCallBox_chevron" src="img/chevron-left.png" width="9" height="16" />
|
||||||
<audio ref="ringAudio" loop>
|
|
||||||
<source src="media/ring.ogg" type="audio/ogg" />
|
|
||||||
<source src="media/ring.mp3" type="audio/mpeg" />
|
|
||||||
</audio>
|
|
||||||
<div className="mx_IncomingCallBox_title">
|
<div className="mx_IncomingCallBox_title">
|
||||||
Incoming { this.state.incomingCall ? this.state.incomingCall.type : '' } call from { caller }
|
Incoming { this.state.incomingCall ? this.state.incomingCall.type : '' } call from { caller }
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user