Forum How do I...?

Is there a way to include an iframe video on a PDF created by Prince

elrond25
I use Youtube and Vimeo videos. Both companies use iframes to show videos. Whenever I generate a PDF using Prince there is either an empty box or a black box where the video should be. is there a way to just display the first frame of the video or include an alternative image where the video would be?
mikeday
Prince cannot load videos, so you would need to replace the element with an alternative image before running Prince, or using JavaScript.
elrond25
Thanks, Mike.

I'll see if I can come up with a solution and post it back.
hallvord
Interesting - how do you embed those videos? Do you use a VIDEO element in the HTML itself, or an IFRAME referencing URLs on their sites - or perhaps a javascript library to insert them?

The video element has a poster attribute typically referencing a screenshot or some other presentational graphic. Perhaps some CSS like (untested)
video{
  background-image: url(attr(poster));
}

might work?

Announcement: repos for tests/utils