Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace a Video in Google Slides with another (or simply replace the URL)

I have a presentation in Google Slides that includes a Video from Drive. I'd like to use an Apps Script to programmatically replace this Video with another, also from Drive.

There are two ways I thought I could approach this:

  1. Change the URL of the existing video in the presentation.
  2. Remove the existing video and insert a new one.

Unfortunately (1) won't work because even though there is a getUrl method for Video, there is no corresponding setUrl method. In fact, I realised that for a Video that has been inserted from Drive, getUrl returns null. You can only use getVideoId to get the Drive id for that video.

I couldn't get (2) to work either. There is an insertVideo method for Slide but it will only work for YouTube videos or for videos that exist in other slides or presentations.

like image 295
George Boukeas Avatar asked Sep 18 '25 06:09

George Boukeas


1 Answers

Currently there is no way of doing it, as you said first option is not possible, and second is not available for Drive, only for Youtube.

I've tried possible workarounds based on the Drive API, specifically modifying the original video binary file with the content of the new one so we could keep the same ID and thus change the video on slides, but it does not work either, don't waste your time trying.

At this point, what I recommend is to submit a Feature request to add the setUrl method on Slides API, or to be able to change the VideoId.

On here you'll be able to do it, remember to add this post over the request.

https://issuetracker.google.com

like image 108
yuri Avatar answered Sep 20 '25 20:09

yuri