OnlyOffice is a great web-based PPT player, but now we have a requirement: how to achieve synchronous playback of PPT in the classroom. For example, when the teacher clicks the PPT play button during the lecture, the student end plays synchronously. My initial idea was to add a listener to the PPT play button, but unfortunately I cannot get the elements in the DOM due to the limitation of iframe. The second idea was to create a plug-in to call the relevant API, but it seems that the plug-in page cannot be seen when the PPT is played in full screen. Can you help me? Thank you very much
Hello @yingshe
Please elaborate on your request as I do not quite understand it.
This description sounds like a simple slideshow: Preview your presentation
If it is not quite what you are looking for, please provide more context to the result you’d like to achieve.
We all know that in traditional teaching, we are used to using screen sharing to share PPT for teaching. However, when the network environment is poor, screen sharing may not be a good choice. However, if we only transmit the operation of PPT, the requirements for the network environment will be greatly reduced. My initial idea is to make a plug-in to receive information transmitted from the outside. When I click the start PPT show button, the service command is used to transmit the information of the start of the show to the plug-in. The plug-in performs the corresponding operation through window.parent.Common.Gateway.on(‘internalcommand’, function(data){}). When I call the api: startslideshow, it succeeds, but when I use gotonextslideshow, it fails and reports an error.
VM4025:1 Uncaught TypeError: Cannot read properties of null (reading ‘postMessage’)
at a.plugin_sendMessage (eval at onMessage (VM4019 plugins.js:199:17), :1:13868)
at a.executeMethod (eval at onMessage (VM4019 plugins.js:199:17), :1:19919)
at Object. (VM4020 main.js:44:25)
at Object. (app.js:8:143657)
at Object.dispatch (app.js:8:39843)
at f.handle (app.js:8:37834)
at Object.trigger (app.js:8:69839)
at Object. (app.js:8:70437)
at w.each (app.js:8:3081)
at w.fn.init.each (app.js:8:1560)
I am quite confused with this description. Plugins are working inside the editor, so I don’t see the point in sending a signal from editor to plugin and back to start a slideshow. Can you elaborate? Specifically on this part:
What is “outside” in this case?
Thank you for your answer. The “outside” part refers to my web application. I need to integrate OnlyOffice into an online classroom. If I want to achieve synchronous operation, I need to be able to listen to the event of the play button being clicked. However, due to the encapsulation problem of ifame, I cannot access the button elements inside the editor. Therefore, I can only make a menu similar to a remote control externally, which includes functions such as play and page turning. When I click play, the information will be passed to the plug-in, and the plug-in will call the relevant API. At the same time, because I can listen to the button click event of the remote control, when the button is clicked, the message will be broadcast to all student terminals to achieve synchronous operation.
I am sorry, but the scenario is still unclear for me. If I follow it right, you want to open presentation from your app on each of students’ devices (PC or laptop) and remotely enable slideshow/switch slides from your device without screensharing? Some kind of manual switch of a slide on each students’ device like they are switching it. Am I getting it right?