return !!this.rtmpServer
}
+ hasSession (sessionId: string) {
+ return this.getContext().sessions.has(sessionId)
+ }
+
stopSessionOf (videoUUID: string, error: LiveVideoError | null) {
const sessionId = this.videoSessions.get(videoUUID)
if (!sessionId) {
const liveSession = await this.saveStartingSession(videoLive)
const user = await UserModel.loadByLiveId(videoLive.id)
- LiveQuotaStore.Instance.addNewLive(user.id, videoLive.id)
+ LiveQuotaStore.Instance.addNewLive(user.id, sessionId)
const muxingSession = new MuxingSession({
context: this.getContext(),
muxingSession.on('after-cleanup', ({ videoUUID }) => {
this.muxingSessions.delete(sessionId)
- LiveQuotaStore.Instance.removeLive(user.id, videoLive.id)
+ LiveQuotaStore.Instance.removeLive(user.id, sessionId)
muxingSession.destroy()