Interactive quiz with users on Livestream Youtube

Asked

Viewed 114 times

0

I have some ideas about creating an application in php or even in another language, where the application responds to chat interactions of a livestream on youtube, for example.

A question displays on live, if the person watching hit the question with an already pre-programmed word, that person’s name is displayed on live, along with the answer, this happening simultaneously in real time.

I’ve been scouring the youtube api, but I couldn’t clear my head, someone has a suggestion?

Thank you!

1 answer

0


Well, seeing a little of the API that youtube provides to be used, there is no form of "socket". Therefore, you will have to keep giving GET from time to time in a specific chat room to return a list of the messages sent. After that, put each message in a stack (to maintain the integrity of the moment the message was sent), or some similar structure and start scanning that stack for what you are interested in. That would be the way I would build such an application. If there is any other better solution, please let me know! :D

In order for the correct message to be displayed on the screen, you will need to connect this application with some livestreaming software (type: xplit, Obs) through some plugin that you will have to implement for them. For this you will have to study a little more about the API of these softwares too! I do not understand much how they work, but I know it is around. If I’m not mistaken, there must already be some plugin that performs the operations that you’re trying to implement. Try to study them! :)

Here’s the documentation that I’ve taken as the basis for this kind of implementation that you’re looking to do: https://developers.google.com/youtube/v3/live/docs

Go to the "Livechatmessages" session and there it will give you the available operations for chat manipulation.

If you have said something wrong, please correct me. Hugs!

  • Very well, it helped a lot, when the mind hangs, it gets hard to think of solutions, but it helped me man, thank you!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.