reveal.js 幻灯片的多重功能

Multiplex functionality with reveal.js slides

我想创建 reveal.js presentations using the slides.com interface to save time, and then add the multiplex 功能以允许控制其他设备上的演示。为此,我编辑了初始化选项和依赖项:

           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 },              
               ]
            });

但是在控制台中出现这个错误,它似乎深深地隐藏在揭示代码中:

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

当我在 reveal 中手动生成这个时,我能够获得多重功能 (controller, listener). But this version breaks (link)。是否有另一种方法可以向 slides.com 生成的演示文稿添加依赖项?

reveal.js 依赖于 head.js 进行依赖加载。但是 head.js 不包含在从幻灯片导出的演示文稿中,因为它不会加载任何依赖项。

要解决此问题,您需要将 head.js 添加到您的演示文稿中:

<script src="https://cdnjs.cloudflare.com/ajax/libs/headjs/0.96/head.min.js"></script>