You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Rename CallFeedPurpose to SDPStreamMetadataPurpose
This is to match MSC3077 Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
@@ -29,7 +29,7 @@ import {EventType} from '../@types/event';
|
|||||||
import { RoomMember } from '../models/room-member';
|
import { RoomMember } from '../models/room-member';
|
||||||
import { randomString } from '../randomstring';
|
import { randomString } from '../randomstring';
|
||||||
import { MCallReplacesEvent, MCallAnswer, MCallOfferNegotiate, CallCapabilities } from './callEventTypes';
|
import { MCallReplacesEvent, MCallAnswer, MCallOfferNegotiate, CallCapabilities } from './callEventTypes';
|
||||||
import { CallFeed, CallFeedPurpose } from './callFeed';
|
import { CallFeed, SDPStreamMetadataPurpose } from './callFeed';
|
||||||
|
|
||||||
// events: hangup, error(err), replaced(call), state(state, oldState)
|
// events: hangup, error(err), replaced(call), state(state, oldState)
|
||||||
|
|
||||||
@@ -422,7 +422,7 @@ export class MatrixCall extends EventEmitter {
|
|||||||
return !this.feeds.some((feed) => !feed.isLocal());
|
return !this.feeds.some((feed) => !feed.isLocal());
|
||||||
}
|
}
|
||||||
|
|
||||||
private pushNewFeed(stream: MediaStream, userId: string, purpose: CallFeedPurpose) {
|
private pushNewFeed(stream: MediaStream, userId: string, purpose: SDPStreamMetadataPurpose) {
|
||||||
// Try to find a feed with the same stream id as the new stream,
|
// Try to find a feed with the same stream id as the new stream,
|
||||||
// if we find it replace the old stream with the new one
|
// if we find it replace the old stream with the new one
|
||||||
const feed = this.feeds.find((feed) => feed.stream.id === stream.id);
|
const feed = this.feeds.find((feed) => feed.stream.id === stream.id);
|
||||||
@@ -775,9 +775,9 @@ export class MatrixCall extends EventEmitter {
|
|||||||
logger.debug(
|
logger.debug(
|
||||||
"Setting screen sharing stream to the local video element",
|
"Setting screen sharing stream to the local video element",
|
||||||
);
|
);
|
||||||
this.pushNewFeed(this.screenSharingStream, this.client.getUserId(), CallFeedPurpose.Screenshare);
|
this.pushNewFeed(this.screenSharingStream, this.client.getUserId(), SDPStreamMetadataPurpose.Screenshare);
|
||||||
} else {
|
} else {
|
||||||
this.pushNewFeed(stream, this.client.getUserId(), CallFeedPurpose.Usermedia);
|
this.pushNewFeed(stream, this.client.getUserId(), SDPStreamMetadataPurpose.Usermedia);
|
||||||
}
|
}
|
||||||
|
|
||||||
// why do we enable audio (and only audio) tracks here? -- matthew
|
// why do we enable audio (and only audio) tracks here? -- matthew
|
||||||
@@ -847,7 +847,7 @@ export class MatrixCall extends EventEmitter {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.pushNewFeed(stream, this.client.getUserId(), CallFeedPurpose.Usermedia);
|
this.pushNewFeed(stream, this.client.getUserId(), SDPStreamMetadataPurpose.Usermedia);
|
||||||
|
|
||||||
this.localAVStream = stream;
|
this.localAVStream = stream;
|
||||||
logger.info("Got local AV stream with id " + this.localAVStream.id);
|
logger.info("Got local AV stream with id " + this.localAVStream.id);
|
||||||
@@ -1271,7 +1271,7 @@ export class MatrixCall extends EventEmitter {
|
|||||||
|
|
||||||
logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);
|
logger.debug(`Track id ${ev.track.id} of kind ${ev.track.kind} added`);
|
||||||
|
|
||||||
this.pushNewFeed(this.remoteStream, this.getOpponentMember().userId, CallFeedPurpose.Usermedia)
|
this.pushNewFeed(this.remoteStream, this.getOpponentMember().userId, SDPStreamMetadataPurpose.Usermedia)
|
||||||
|
|
||||||
logger.info("playing remote. stream active? " + this.remoteStream.active);
|
logger.info("playing remote. stream active? " + this.remoteStream.active);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
|
|
||||||
import EventEmitter from "events";
|
import EventEmitter from "events";
|
||||||
|
|
||||||
export enum CallFeedPurpose {
|
export enum SDPStreamMetadataPurpose {
|
||||||
Usermedia = "usermedia",
|
Usermedia = "usermedia",
|
||||||
Screenshare = "screenshare",
|
Screenshare = "screenshare",
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ export class CallFeed extends EventEmitter {
|
|||||||
constructor(
|
constructor(
|
||||||
public stream: MediaStream,
|
public stream: MediaStream,
|
||||||
public userId: string,
|
public userId: string,
|
||||||
public purpose: CallFeedPurpose,
|
public purpose: SDPStreamMetadataPurpose,
|
||||||
private client: any, // Fix when client is TSified
|
private client: any, // Fix when client is TSified
|
||||||
private roomId: string,
|
private roomId: string,
|
||||||
) {
|
) {
|
||||||
|
|||||||
Reference in New Issue
Block a user