Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiplex functionality with reveal.js slides

I want to create reveal.js presentations using the slides.com interface to save time, and then add the multiplex functionality to allow controlling of the presentation on other devices. To do this, I edited the initialize options and dependencies:

           Reveal.initialize({
                multiplex:{
                    secret: null, // Obtained from the socket.io server. Gives this (the master) control of the presentation
                    id: ID,
                    url: NODEURL // Location of socket.io server
                },              
               dependencies: [
                    { src: '//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.10/socket.io.min.js', async: true },
                    { src: 'reveal/plugin/multiplex/client.js', async: true },              
               ]
            });

But get this error in the console, that seems deeply buried in the reveal code:

Uncaught ReferenceError: head is not defined (index: 46)

When I produce this manually in reveal, I'm able to get the multiplex functionality (controller, listener). But this version breaks (link). Is there another way of adding dependencies to the presentations produced from slides.com?

like image 203
mike Avatar asked Mar 31 '15 19:03

mike


People also ask

How to create a presentation using reveal JS?

When you’re going to create a new presentation, you need to copy all files of reveal.js to another folder, create a Markdown file and add the content of the slides. Every time you give a talk or a workshop you need to find the folder where you saved your presentation and open the index.html file in your favorite browser.

How does the multiplex plugin work?

The multiplex plugin allows your audience to follow the slides of the presentation you are controlling on their own phone, tablet or laptop. When you change slides in your master presentations everyone will follow and see the same content on their own device.

What is reveal JS Gallery?

reveal.js Gallery exists as a way to better organize and access all of your presentations from one place. It was a weekend project and the first version of the application showed a form like the following where it lists all of your presentations. After selecting the presentation and pressing the button “ Open ”, slides were loaded in browser.

What can I do in my reveal presentation?

Presentations made with reveal.js are built on open web technologies. That means anything you can do on the web, you can do in your presentation. Change styles with CSS, include an external web page using an <iframe> or add your own custom behavior using our JavaScript API.


1 Answers

reveal.js relies on head.js for dependency loading. However head.js is not included in the exported presentation from Slides since that doesn't load any dependencies.

To fix this you'll need to add head.js to your presentation:

<script src="https://cdnjs.cloudflare.com/ajax/libs/headjs/0.96/head.min.js"></script>
like image 144
hakim Avatar answered Sep 25 '22 12:09

hakim