Skip to content

Commit

Permalink
detachをコンポーネントのみにした
Browse files Browse the repository at this point in the history
  • Loading branch information
nokhnaton committed Jan 22, 2025
1 parent 1c2f3dd commit dd5333f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/components/Main/MainView/QallView/AudioTrack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ onMounted(() => {
})
onUnmounted(() => {
trackInfo.trackPublication?.track?.detach()
if (audioElement.value) {
trackInfo.trackPublication?.track?.detach(audioElement.value)
}
})
</script>

Expand Down
2 changes: 0 additions & 2 deletions src/components/Main/MainView/QallView/QallView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import CallControlButton from './CallControlButton.vue'
import CallControlButtonSmall from './CallControlButtonSmall.vue'
import ScreenShareComponent from './ScreenShareComponent.vue'
import { LocalTrackPublication } from 'livekit-client'
import VideoTrack from '/@/components/Main/MainView/QallView/VideoTrack.vue'
const {
tracksMap,
Expand Down Expand Up @@ -196,7 +195,6 @@ const backgroundType = ref<'original' | 'blur' | 'file' | 'screen'>('original')
<VideoComponent
v-if="
track.trackPublication?.kind === 'video' &&
!(track.trackPublication.track instanceof VideoTrack) &&
!screenShareTrackSidMap.has(sid)
"
:track-info="track"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ onMounted(() => {
})
onUnmounted(() => {
trackInfo.trackPublication?.track?.detach()
audioTrackInfo?.trackPublication?.track?.detach()
if (videoElement.value && audioElement.value) {
trackInfo.trackPublication?.track?.detach(videoElement.value)
audioTrackInfo?.trackPublication?.track?.detach(audioElement.value)
}
})
</script>

Expand Down
4 changes: 3 additions & 1 deletion src/components/Main/MainView/QallView/VideoTrack.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ onMounted(() => {
})
onUnmounted(() => {
trackInfo.trackPublication?.track?.detach()
if (videoElement.value) {
trackInfo.trackPublication?.track?.detach(videoElement.value)
}
})
</script>

Expand Down

0 comments on commit dd5333f

Please sign in to comment.