Page 1 of 1

Questions about extension with network

Posted: 03 May 2013 09:57
by pathsny
Hi,
I'm trying to create an extension that allows me to "chat" with other people (with the text showing up on the osd). In order to make sure that this works in a variety of environments my plan was to
1) get the extension to make a socket connection to a server
2) send messages out on the socket
3) on recieving a message from the socket, display it on the screen.

I have certain questions about this
1) I cannot poll in a loop on the socket to read messages because that seems to block indefinetly and vlc ultimately seems to believe the script is stuck
2) I do not see any specific timer event to check the socket periodically for new messages
3) I do not want to listen for incoming connections or listen on http because some people using this extension might be behind a firewall.

is there any other solution that appears viable?
thanks

Re: Questions about extension with network

Posted: 06 May 2013 00:19
by Etoh
Is this related to the Simulwatch project which dhruvbird posted about (Register a callback for new data available on a socket)?

One project I am working on is Syncplay, which allows for multiple people with the same video to watch it together. However, it expects people use something like Mumble to chat. The VLC version is not public yet, but it connects to another server using the "host" module (which I think is only available for interfaces) and an "accept_and_select" loop. Source for the beta Syncplay VLC interface is available from: https://github.com/Uriziel/syncplay/blo ... ncplay.lua

You might also be interested in looking at the code by jwatzman for vlc-sync: https://github.com/jwatzman/vlc-sync

Re: Questions about extension with network

Posted: 07 May 2013 12:41
by Jean-Baptiste Kempf
You know that we have netsync, in VLC?

Re: Questions about extension with network

Posted: 07 May 2013 22:34
by Etoh
You know that we have netsync, in VLC?
If I recall correctly netsync has a single 'master', so only one client can pause, unpause and seek (which is fine for synchronising a video wall or multiple speakers at a party). Other solutions can allow for everyone connected to the same viewing session to control playback (as in Syncplay) or might allow for text-based chat (as is being proposed here).

Re: Questions about extension with network

Posted: 12 May 2013 01:52
by Jean-Baptiste Kempf
As soon as there are many users, allowing everyone to control will have issues...

Re: Questions about extension with network

Posted: 13 May 2013 00:07
by Etoh
As soon as there are many users, allowing everyone to control will have issues...
You might start getting issues with more than half a dozen users (or less if you have a high number of novices or involve random strangers), but we've been regularly using Syncplay with up to around 5 users for about a year and that's been working fine.

The main problem encountered is when two people try to unpause at the same time using a play/pause toggle as this can result in the second person inadvertently repausing the video. However, that is only a minor inconvenience.

Two important elements to effective joint-viewing is the method of communication during playback and the individuals involved. In my experience voice chat using Mumble works best for communication, but if you don't want to talk over dialogue then text chat can also work. When it comes to people, it is best to watch things with people you know, but if there is someone messing around then it is easy enough to identify and exclude them.