Why isn’t the video showing? please help me track down the error.
def add_video_from_youyube(pres, videoId): #add videoFrame
link = "https://www.youtube.com/embed/" + videoId;
thumbnail_uri = "http://img.youtube.com/vi/" + videoId + "/hqdefault.jpg"
f = urlopen(thumbnail_uri)
with urlopen(link) as videofile:
videoContent = videofile.read().rstrip()
video = pres.videos.add_video(videoContent) # Add the Video Frame inside the slide
videoFrm = pres.slides[5].shapes.add_video_frame(50, 150, 300, 350, link) #Insert the MP$ video inside the Video Frame
videoFrm.embedded_video = video # Set the options of play mode and volume of the video
videoFrm.play_mode = slides.VideoPlayModePreset.AUTO
videoFrm.volume = slides.AudioVolumeMode.LOUD
videoFrm.picture_format.picture.image = pres.images.add_image(f.read())
add_video_from_youyube(presentation, "FbzsPHJskcg")
@Mahadhj2b,
Thank you for contacting support. I am working on the issue and will get back to you as soon as possible.
@Mahadhj2b,
With Aspose.Slides for Python 23.8, I was unable to reproduce the problem. The video is showing.
My output presentation: output.zip (105.2 KB)
We need more details on how to reproduce the problem and help you.
Not working on android(microsoft 365, andr open office)/web
@Mahadhj2b,
I’ve reproduced the problem you described. But I’ve also added the video to a presentation using PowerPoint manually by the link and found that the video also is not played in Office 365 on Android. It looks like videos added by links are showing only in Slide Show mode.
Is it possible to make the video appear directly in the presentation? In slide show mode it gives me a YouTube shortcut to the video
@Mahadhj2b,
Could you please share a sample presentation where a video behaves as you expected?
@Mahadhj2b,
Thank you for the presentation file. I will get back to you as soon as possible.
@Mahadhj2b,
In the presentation you provided, the video was added from a local file (not by a link). This can be done like this:
slide.shapes.add_video_frame(20, 20, 300, 150, "sample.avi")
More details:
API Reference: VideoFrame class