Skip to content

Commit

Permalink
DOES NOT WORK
Browse files Browse the repository at this point in the history
  • Loading branch information
jamsea committed Oct 17, 2022
1 parent 3443086 commit 8871dca
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/components/VideoTile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
import CallControls from "./CallControls.vue";
import NoVideoTile from "./NoVideoTile.vue";
export default {
import { defineComponent } from "vue";
interface VideoTileData {
audioSource: MediaStream | null;
videoSource: MediaStream | null;
username: string;
}
export default defineComponent({
name: "VideoTile",
components: {
CallControls,
Expand All @@ -50,29 +58,21 @@ export default {
"leaveCall",
"disableScreenShare",
],
data() {
data(): VideoTileData {
return {
videoSource: null,
audioSource: null,
username: "Guest",
};
},
mounted() {
console.log("mounmted participant", this.participant);
console.log("mounmted participant", );
this.handleVideo(this.videoTrack);
// this.handleAudio(this.audioTrack);
},
updated() {
// this.username = this.participant?.user_name;
// // For later optimization, this can be done more selectively
// // using "track-started" and "track-stopped" events.
// this.handleVideo(this.participant.videoTrack);
// this.handleAudio(this.participant);
this.handleAudio(this.audioTrack, this.local);
},
methods: {
// Add srcObject to video element
handleVideo(videoTrack) {
console.log("handleVideo", videoTrack);
// If the participant has their video off,
// early out.
Expand All @@ -85,14 +85,14 @@ export default {
},
// Add srcObject to audio element
handleAudio() {
const p = this.participant;
handleAudio(audioTrack, local) {
console.log("handleAudio", audioTrack, local);
// If the participant is local or has their audio off,
// early out.
if (!p || p.local || !p.audio) return;
if (local || !audioTrack) return;
const track = p.tracks.audio.persistentTrack;
const newStream = this.updateSource(this.audioSource, track);
const newStream = this.updateSource(this.audioSource, audioTrack);
if (newStream) {
this.audioSource = newStream;
}
Expand Down Expand Up @@ -123,7 +123,7 @@ export default {
return null;
},
},
};
});
</script>

<style scoped>
Expand Down

0 comments on commit 8871dca

Please sign in to comment.