Skip to content

Commit 519f227

Browse files
committed
Remove typescript
1 parent 018403e commit 519f227

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

src/components/CallTile.vue

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,7 @@
4444
<script>
4545
import { defineComponent } from "vue";
4646
47-
import daily, {
48-
type DailyCall,
49-
type DailyEventObjectAppMessage,
50-
type DailyEventObjectFatalError,
51-
type DailyParticipant,
52-
} from "@daily-co/daily-js";
47+
import daily from "@daily-co/daily-js";
5348
5449
import WaitingCard from "./WaitingCard.vue";
5550
import ChatTile from "./ChatTile.vue";
@@ -82,7 +77,7 @@ export default defineComponent({
8277
required: true,
8378
},
8479
},
85-
data(): CallTileData {
80+
data() {
8681
return {
8782
callObject: null,
8883
participants: [],
@@ -161,7 +156,7 @@ export default defineComponent({
161156
});
162157
},
163158
methods: {
164-
updateMedia(participantID: string, newTracks: Tracks) {
159+
updateMedia(participantID, newTracks) {
165160
// Get the video tag.
166161
let videoTile = document.getElementById(
167162
participantID
@@ -188,7 +183,7 @@ export default defineComponent({
188183
// This will happen if this is the first time we're
189184
// setting the tracks.
190185
if (!existingStream || existingStream.getTracks().length === 0) {
191-
const tracks: MediaStreamTrack[] = [];
186+
const tracks = [];
192187
if (newVideo) tracks.push(newVideo);
193188
if (newAudio) tracks.push(newAudio);
194189
const newStream = new MediaStream(tracks);
@@ -223,30 +218,30 @@ export default defineComponent({
223218
}
224219
},
225220
refreshAudioTrack(
226-
existingStream: MediaStream,
227-
newAudioTrack: MediaStreamTrack | null
228-
): boolean {
221+
existingStream,
222+
newAudioTrack
223+
) {
229224
// If there is no new track, just early out
230225
// and keep the old track on the stream as-is.
231226
if (!newAudioTrack) return false;
232227
const existingTracks = existingStream.getAudioTracks();
233228
return this.refreshTrack(existingStream, existingTracks, newAudioTrack);
234229
},
235230
refreshVideoTrack(
236-
existingStream: MediaStream,
237-
newVideoTrack: MediaStreamTrack | null
238-
): boolean {
231+
existingStream,
232+
newVideoTrack
233+
) {
239234
// If there is no new track, just early out
240235
// and keep the old track on the stream as-is.
241236
if (!newVideoTrack) return false;
242237
const existingTracks = existingStream.getVideoTracks();
243238
return this.refreshTrack(existingStream, existingTracks, newVideoTrack);
244239
},
245240
refreshTrack(
246-
existingStream: MediaStream,
247-
oldTracks: MediaStreamTrack[],
248-
newTrack: MediaStreamTrack
249-
): boolean {
241+
existingStream,
242+
oldTracks,
243+
newTrack
244+
) {
250245
const trackCount = oldTracks.length;
251246
// If there is no matching old track,
252247
// just add the new track.
@@ -269,7 +264,7 @@ export default defineComponent({
269264
}
270265
return false;
271266
},
272-
playMedia(video: HTMLVideoElement) {
267+
playMedia(video) {
273268
const isPlaying =
274269
!video.paused &&
275270
!video.ended &&
@@ -286,8 +281,8 @@ export default defineComponent({
286281
console.warn("Failed to play media.", e);
287282
});
288283
},
289-
getParticipantTracks(p: DailyParticipant) {
290-
const mediaTracks: Tracks = {
284+
getParticipantTracks(p) {
285+
const mediaTracks = {
291286
videoTrack: null,
292287
audioTrack: null,
293288
};
@@ -312,13 +307,13 @@ export default defineComponent({
312307
return mediaTracks;
313308
},
314309
// Add chat message to local message array
315-
updateMessages(e: DailyEventObjectAppMessage<any> | undefined) {
310+
updateMessages(e) {
316311
if (!e) return;
317312
console.log("[MESSAGE] ", e.data);
318313
this.messages.push(e?.data);
319314
},
320315
// Show local error in UI when daily-js reports an error
321-
handleError(e: DailyEventObjectFatalError | undefined) {
316+
handleError(e) {
322317
if (!e) return;
323318
console.log("[ERROR] ", e);
324319
this.error = e.errorMsg;
@@ -357,7 +352,7 @@ export default defineComponent({
357352
* because they do no receive an app-message Daily event for their
358353
* own messages.
359354
*/
360-
sendMessage(text: string) {
355+
sendMessage(text) {
361356
if (!this.callObject) return;
362357
// Attach the local participant's username to the message to be displayed in ChatTile.vue
363358
const local = this.callObject.participants().local;

0 commit comments

Comments
 (0)