Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit73134be

Browse files
committed
let session own the slots until close
1 parent21e82ed commit73134be

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/App.vue‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ function close() {
7777
}
7878
7979
if (localVideo.value)localVideo.value.srcObject=null;
80-
remoteVideos.value.forEach((v)=> (v.srcObject=null));
81-
remoteAudios.value.forEach((a)=> (a.srcObject=null));
8280
8381
session.value=null;
8482
connected.value=false;

‎src/lib.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export class Session {
1818
privatelastError:Error|null=null;
1919
privatevideoTrans:RTCRtpTransceiver;
2020
privateaudioTrans:RTCRtpTransceiver;
21+
privatevideoSlots:HTMLVideoElement[];
22+
privateaudioSlots:HTMLAudioElement[];
2123

2224
constructor(config:SessionConfig){
2325
constpc=newRTCPeerConnection();
@@ -81,6 +83,8 @@ export class Session {
8183
this.deleteUri=null;
8284
this.videoTrans=videoTrans;
8385
this.audioTrans=audioTrans;
86+
this.videoSlots=[...config.videoSlots];
87+
this.audioSlots=[...config.audioSlots];
8488
}
8589

8690
publish(stream:MediaStream){
@@ -114,6 +118,8 @@ export class Session {
114118
}
115119

116120
this.pc.close();
121+
this.audioSlots.forEach((v)=>(v.srcObject=null));
122+
this.videoSlots.forEach((a)=>(a.srcObject=null));
117123
}
118124

119125
privateasyncconnectInternal(endpoint:string,room:string){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp