add rining to outgoing call, convert souds to much smaller m4a
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -26,7 +26,7 @@
|
|||||||
"umd/index.dev.js.map",
|
"umd/index.dev.js.map",
|
||||||
"umd/tinode.prod.js",
|
"umd/tinode.prod.js",
|
||||||
"umd/tinode.dev.js",
|
"umd/tinode.dev.js",
|
||||||
"audio/*.mp3",
|
"audio/*.m4a",
|
||||||
"css/base.css",
|
"css/base.css",
|
||||||
"css/base.min.css",
|
"css/base.min.css",
|
||||||
"img/*.png",
|
"img/*.png",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { CALL_STATE_INCOMING_RECEIVED } from '../constants.js';
|
|||||||
import { makeImageUrl } from '../lib/blob-helpers.js';
|
import { makeImageUrl } from '../lib/blob-helpers.js';
|
||||||
import { clipStr } from '../lib/utils.js'
|
import { clipStr } from '../lib/utils.js'
|
||||||
|
|
||||||
const RING_SOUND = new Audio('audio/call-in.mp3');
|
const RING_SOUND = new Audio('audio/call-in.m4a');
|
||||||
|
|
||||||
export default class IncomingCallView extends React.Component {
|
export default class IncomingCallView extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ import { secondsToTime } from '../lib/strformat.js'
|
|||||||
import { updateFavicon } from '../lib/utils.js';
|
import { updateFavicon } from '../lib/utils.js';
|
||||||
|
|
||||||
// Sound to play on message received.
|
// Sound to play on message received.
|
||||||
const POP_SOUND = new Audio('audio/msg.mp3');
|
const POP_SOUND = new Audio('audio/msg.m4a');
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
reconnect_countdown: {
|
reconnect_countdown: {
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ import { CALL_STATE_OUTGOING_INITATED, CALL_STATE_IN_PROGRESS } from '../constan
|
|||||||
|
|
||||||
import { clipStr } from '../lib/utils.js'
|
import { clipStr } from '../lib/utils.js'
|
||||||
|
|
||||||
|
const RING_SOUND = new Audio('audio/call-out.m4a');
|
||||||
|
RING_SOUND.loop = true;
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
already_in_call: {
|
already_in_call: {
|
||||||
id: 'already_in_call',
|
id: 'already_in_call',
|
||||||
@@ -133,6 +136,9 @@ class CallPanel extends React.PureComponent {
|
|||||||
.then(stream => {
|
.then(stream => {
|
||||||
this.setState({localStream: stream});
|
this.setState({localStream: stream});
|
||||||
this.localRef.current.srcObject = stream;
|
this.localRef.current.srcObject = stream;
|
||||||
|
|
||||||
|
RING_SOUND.play();
|
||||||
|
|
||||||
// Send call invitation.
|
// Send call invitation.
|
||||||
this.props.onInvite(this.props.topic, this.props.seq, this.props.callState);
|
this.props.onInvite(this.props.topic, this.props.seq, this.props.callState);
|
||||||
})
|
})
|
||||||
@@ -140,6 +146,9 @@ class CallPanel extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
RING_SOUND.stop();
|
||||||
|
RING_SOUND.currentTime = 0;
|
||||||
|
|
||||||
this.stopTracks(this.localRef.current);
|
this.stopTracks(this.localRef.current);
|
||||||
this.stopTracks(this.remoteRef.current);
|
this.stopTracks(this.remoteRef.current);
|
||||||
if (this.state.pc) {
|
if (this.state.pc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user