Multiplex functionality with reveal.js slides

我的梦境 提交于 2019-12-23 12:17:53

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/29377010/multiplex-functionality-with-reveal-js-slides

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!