Explicitly make React use the same audio element.. Use a 'key' and comment why it is required.

This commit is contained in:
Kegan Dougal 2015-10-28 11:43:13 +00:00
parent 05dba9c2d4
commit 35862e0c66
1 changed files with 3 additions and 4 deletions
src/skins/vector/views/molecules/voip

View File

@ -32,11 +32,10 @@ module.exports = React.createClass({
render: function() { render: function() {
// NB: This block MUST be the first thing inside the <div> else react won't // NB: This block MUST have a "key" so React doesn't clobber the elements
// know that they refer to the same thing and so will clobber them between // between in-call / not-in-call.
// in-call / not-in-call resulting in no inbound audio.
var audioBlock = ( var audioBlock = (
<audio ref="ringAudio" loop> <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>