From 6403f2dee014e26c0587acb055a8b11043895689 Mon Sep 17 00:00:00 2001 From: Tdxdxoz Date: Sun, 11 Apr 2021 00:31:46 +0800 Subject: [PATCH] feat: show user detail --- static/index.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/static/index.js b/static/index.js index 72be570..18cc6ac 100644 --- a/static/index.js +++ b/static/index.js @@ -96,13 +96,22 @@ async function subscribe(user, mediaType) { // subscribe to a remote user await client.subscribe(user, mediaType); console.log("subscribe success"); - const player = $(` -
-

${uid}

- -
- `); - $("#remote-playerlist").append(player); + $.getJSON(`api/user/${uid}`, function (user) { + console.log(user); + const player = $(` +
+

+ + + ${user.disp} @${user.acct} + + ) +

+ +
+ `); + $("#remote-playerlist").append(player); + }); user.audioTrack.play(); user.intervalId = window.setInterval(set_soundmeter, 20, `#player-${uid} progress`, user.audioTrack); }