invisible-college / tawk.space

Social video chats
https://tawk.space
Apache License 2.0
14 stars 1 forks source link

Unclear why videos take so long to load #4

Closed karth295 closed 8 years ago

karth295 commented 8 years ago

When I first open up tawk, it takes at least couple seconds for me to see my video stream and everybody else in the room. It gets worse when you're on a slow connection and the handshaking takes a long time.

Currently, tawk says that the remote stream is "muted" with no video until getting the remote stream. Instead, it should show something like "loading" until it gets the video stream.

toomim commented 8 years ago

Part of this is because of the multiple round trips when loading a statebus app. First it loads the html, then it fetches client.js. This fetches statebus.js and react.js and sock.js. These run, and then start fetching state from the server. Then when the state has fetched, it draws the html, which includes the black "muted" video streams.

karth295 commented 8 years ago

I don't think this is a problem with rendering too early--it was just lazy programming. There's an if statement that is something like like if not person.has_video or not received_streams[person.id] -> draw black box that says muted. Those should be two different cases. If the remote isn't giving people their video, they should be a black box (or avatar, gif, picture, etc). If we haven't received their stream from Janus yet, there should be a spinning bar.

karth295 commented 8 years ago

I have a POC for this live.

toomim commented 8 years ago

Rad