Multiplex functionality with reveal.js slides
Asked Answered
R

1

6

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?

Rhodie answered 31/3, 2015 at 19:34 Comment(0)
T
15

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>
Tatia answered 1/4, 2015 at 6:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.