Search code examples
google-slides-apigoogle-slides

Is it possible to use external control elements with an embedded Google Slides presentation?


I'm going to be working on a project that involves embedded Google Slides presentations, and I haven't been able to find any information regarding whether or not it is possible to use external HTML elements as controls (play, next slide, previous slide, etc.) for a presentation or if I'm stuck with the default controls in the iframe. Anyone have experience with this?


Solution

  • Answer:

    Due to the same-origin policy, this will be unable to be done.

    More Information:

    Embedding a Google Slides presentation in an HTML page will require using some sort of object like an iframe which is going to be subject to the same-origin policy restrictions.

    In practice, this means that if you have a page embedded inside another, they can not interact with one another unless they have the same origin.

    As per the MDN documentation about the same-origin policy:

    enter image description here

    That is to say, unless the Slides file and the webpage are hosted on the same domain, no interaction between them will be able to be accomplished - this even includes Google Sites as Sites and Slides are hosted on different sub-domains (https://sites.google.com/ and https://docs.google.com/presentation/ respectively).

    References:


    Related Questions: