Questions about extension with network

Discuss your Lua playlist, album art and interface scripts.
pathsny
New Cone
New Cone
Posts: 2
Joined: 03 May 2013 09:52

Questions about extension with network

Postby pathsny » 03 May 2013 09:57

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

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: Questions about extension with network

Postby Etoh » 06 May 2013 00:19

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

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Questions about extension with network

Postby Jean-Baptiste Kempf » 07 May 2013 12:41

You know that we have netsync, in VLC?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: Questions about extension with network

Postby Etoh » 07 May 2013 22:34

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).

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Questions about extension with network

Postby Jean-Baptiste Kempf » 12 May 2013 01:52

As soon as there are many users, allowing everyone to control will have issues...
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Etoh
Blank Cone
Blank Cone
Posts: 60
Joined: 12 Jan 2013 16:33

Re: Questions about extension with network

Postby Etoh » 13 May 2013 00:07

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.


Return to “Scripting VLC in lua”

Who is online

Users browsing this forum: No registered users and 7 guests