Skip to content
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

Implement a nodejs-backend for websockets support #21

Open
paulrouget opened this issue Aug 6, 2011 · 14 comments
Open

Implement a nodejs-backend for websockets support #21

paulrouget opened this issue Aug 6, 2011 · 14 comments
Labels

Comments

@paulrouget
Copy link
Owner

It would be interesting to synchronize slides through WebSockets. A master would control any instances of the presentation (slaves).

I did that before: http://paulrouget.com/e/paulatparisweb/ (sorry, in french).

@flatsiedatsie
Copy link

@Hywan
Copy link

Hywan commented Dec 1, 2011

Hey :),

I did this with a PHP library (Hoa\Websocket). The repository is here: http://hg.hoa-project.net/Keynote/file/tip. Look at Shells/Mirror.html, Shells/Script/Mirror.* and Shells/Script/Onstage.js (where I add one method: Dz.startSocket).
The mirror shell supports notes (with localStorage), a red light that turns to green when connected and slides control is made from the onstage shell.

@flatsiedatsie
Copy link

Awesome! Do you have a zip somewhere? I never get why some of these repositories make it so hard to download them as a zip :-(

Otherwise I'll try and save each page one by one.

Do you have some more n00b-friendly explanation of how it works? What URL do you open on your mobile browser?

@Hywan
Copy link

Hywan commented Dec 12, 2011

Sorry for the late reply.
All you have to do is cloning the repository like this: $ hg clone http://hg.hoa-project.net/Keynote /tmp/keynote and that's all. This interface (hgweb) has no stub/archive system enabled for now, sorry.

Note for everyone else: the Websocket protocol is released under the RFC6455 (please, see http://j.mp/w3TvkK). I'll try to take time to update the PHP library I used (aka Hoa\Websocket) which is based on the -09 draft for now, as soon as possible.

@flatsiedatsie
Copy link

In the end I copied it manually (raw-link -> right-click -> save-as, repeat), but couldn't get it to work. Learnt a lot though, like needing your server to support it, etc.

@Hywan
Copy link

Hywan commented Dec 21, 2011

You need Hoa for sure.
Follow these steps:
$ hg clone http://hg.hoa-project.net/Central /usr/local/lib/hoa
$ hg clone http://hg.hoa-project.net/Keynote /tmp/keynote
$ cd !!$
$ php Shells/Script/Mirror.php&
Now, open file:///tmp/keynote/Shells/Onstage.html#file:///tmp/keynote/PHPTour11.html to command your slides.
And then, on your local network (127.0.0.1), open file:///tmp/keynote/Shells/Mirror.html#file:///tmp/keynote/PHPTour11.html and it works :-). One thing: the Websocket -09 draft is no longer compatible with the last draft, aka RFC6455. That's why Hoa\Websocket is not working on the last Firefox nightly. If you try with Safari for example, it will work (because it's not up to date). I'm trying to update Hoa\Websocket until December.

@pci
Copy link

pci commented Jan 12, 2012

I recently made something like this for a presentation I gave and I learnt a few things:

  • To support a wide range of browsers I had to rely on socket.io pretty heavily
  • Because of this it required the socket.io library and some hacking of the dzslide core, breaking the all-in-one-page rule

There is at least one possible way forward: have two shells one called 'control' and one 'viewer' that present themselves to dzslides as another view and convert any messages to/from websockets. I don't mind making these but I would like to know others think it's a good idea before I spend the time on them.

On the plus side the node.js code is very simple :)

@hsablonniere
Copy link
Collaborator

Hi everyone.

I don't have anything against PHP but I'd rather go for a nodejs implementation.

@pci Your idea with two shells one conrol and one viewer is excellent. It's exactly what I implemented for my web dev courses. The students had a modified embedder and I had a modified onstage that talked to each other through a long polling Java server.

I have more ideas concerning this synchronization feature. What I have in mind could be a whole new project, "DZsomething" that uses DZslides files and provide various synchronization features between speaker and audience. Here's some ideas :

  • Who's connected (or how many people)
  • Exchange text or source code (mix of etherpad and jsfiddle)
  • Throw quizzes or polls. Audience answers and results get displayed on big screen
  • And of courses synchronizing DZslides actions (slide changes, video playback, etc...)

Those are ideas from my teacher point of view but it can also be relevant in a speaker/conference environement.

For this to success, we need a very abstract solution that anyone can hack upon.

@paulrouget @pci What's your opinion on that?

@itpastorn
Copy link
Contributor

Would it be possible to make an api that could make it possible for different server side sync solutions? There are still lots and lots of PHP and ASP hosts but not so many nodejs ones?

@hsablonniere
Copy link
Collaborator

Yeah you're right. We could provide a reference implementation in nodejs with a clean and abstract API/protocol. That's why I think we may need a separate project.

@Hywan
Copy link

Hywan commented Mar 5, 2012

The API is very simple. All we have to do is editing Dz.postMsg for redirecting/cloning all messages on a connected Websocket. Do I propose a patch?

@hsablonniere
Copy link
Collaborator

I already started some work on that. Thanks.

For now the priority is on the v2 tagged issues. We'll resume that just after.

@hsablonniere
Copy link
Collaborator

Note for later : https://github.com/groovecoder/dzslides

@paulrouget
Copy link
Owner Author

(DZServer :D)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants