New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chat messages works well #60
Comments
will check this. |
thank you for fast reply, i love your live connector! it's the best! I was trying do do this kind of socket connection but i failed, when i saw this library it was like blessing to me |
i am also sending tiktok messages from backend to frontend via websocket library maybe it has some delay or it's just skips messages? i can show you my code but it's very boilerplate i don't think that problem in my code I AM USING http-server -a localhost -p 8000 to start frontend index.html file THIS IS MY BACKEND CODE
THIS IS FRONTEND WAY TO RECEIVE MESSAGES
|
Please use this code for testing: const { WebcastPushConnection } = require('tiktok-live-connector');
let connection = new WebcastPushConnection('@user');
connection.on('chat', data => console.log(data.uniqueId, data.comment));
connection.connect().catch(err => console.error(err)); ...And see if the problem also occurs with that code. |
Ok i will try it |
OK i just tested, looks like it's working fine. I am sorry about that. Something wrong with my code or may be my eyes. I am very sorry that i took your time on that. Looks like i need some kind of array that storing messages and just sending them to client one after another with little delay, or on the client side receive messages and show them with little delay, because if tiktok sends alot of messages it's like many at same time and looks like showing up the last one so problem with my application and the way i am rendering messages, it's not your issue, i am very sorry. Thank you for fast feedback. Love your |
I fixed my code, it works nice, solution was too simple, i created array of messages and each time message come i just write it to array, and then i use setInterval(render, 100) and each 100 ms the first message of array showing up and removing from array so if somebody needs this kind of functionality this is how i made it |
Thank you author for such amazing library, 9999.... likes to you |
Thanks! Good to hear that everything is working now :) |
Hello i am from Ukraine and my english is bad and i faced with problem, when your stream watching few people it's ok to use this library and i can get every message from chat, but if my stream watching from 300 to 1.5k people and every body writing messages to chat, this TikTol-Live-Connector lib starts skipping chat messages, when i compare it with tiktok chat on my device it looks like messages come in batches and this tiktok live connector library just showing the last message, you know tiktok server sending like 5-10 messages same time and library only shows last one, please test this on very active stream and see what i am trying to describe! if you understand me please tell me what to do to fix it somehow, maybe i can get messages in some kind of array?
The text was updated successfully, but these errors were encountered: