how to handle embedded videos ?

1 view
Skip to first unread message

chr.pfeiffer

unread,
Dec 2, 2011, 4:46:56 AM12/2/11
to wikipu...@googlegroups.com
Hi there,

in which way should embedded videos be handled?

In the wiki syntax I have for example:
( In pmwiki (pmwiki-2.2.25) I have swf-sites enabled )

The html output is for example:
<p>
<object type='application/x-shockwave-flash' width='425' height='344' data='http://www.youtube-nocookie.com/v/8GJeLW7Bh7E?fs=1&hd=1'>
  <param name='wmode' value='transparent' />
  <param name='allowFullScreen' value='true' />
  <param name='allowscriptaccess' value='always' />
</object>
</p>

In the conversion process I get nothing in xml, just the <p></p>, hence nothing in the generated pdf.

I think a nice way would be
a) showing a still of the embedded video with the link to the video
or
b) just the link to the video


Sadly I can only use server version 2.2.19 at the moment in production, so if there is already this feature in newer versions I'm sorry for bothering.

keep up the good work!




JR

unread,
Dec 4, 2011, 3:30:13 PM12/4/11
to wikipublisher
The Flash recipe generates HTML tags for embedding the movie, and
because these are not wikibook xml, wikipublisher removes them.

In local/config.php, try

if($format != 'pdf') include_once('cookbook/swf-sites.php');

and make sure this line is *after* you load the wikipublisher
extensions.

This should make pmwiki treat youtube links as regular external links.

> I think a nice way would be
> a) showing a still of the embedded video with the link to the video

This will require some more work. Do you know if it is possible to
request a still from youtube as a png image? If so, do you know the
form of the url that does this? If it is possible to ask youtube for a
still image in the form of a png file, we can insert this in the pdf,
with a link to the video. Alternatively, if you have suitable still
images, and can upload them using Attach:8GJeLW7Bh7E.png (using the id
in the example), we could get wikipublisher to use this image to link
to the video.


> or
> b) just the link to the video
>

It should be possible to add support for [[http://www.youtube.com/
watch?v=8GJeLW7Bh7E | some link text]] and use the link text in the
pdf. I think we could do this with a new html markup rule that removes
the link text before swf-sites processes the link. For the pdf, we can
either let wikipublisher put the link in a footnote as normal, or try
to get it to treat these as a special case.

Hope this helps
JR

On Dec 2, 10:46 pm, "chr.pfeiffer"

chr.pfeiffer

unread,
Dec 4, 2011, 4:32:41 PM12/4/11
to wikipu...@googlegroups.com
thanks JR,

before i can try your changes, here's answer for youtubes still picture handling:

image as jpg, didn't find png generation

video source

320x240 image

pattern

Thank you so much for your great work!

JR

unread,
Dec 4, 2011, 10:28:35 PM12/4/11
to wikipublisher
Try this:

if ($format == 'pdf')
Markup('youtube', '>inline',
'/(http:\/\/)www(\.youtube\.com\/)watch\?v=([^&\s]+)(&[^\s]+)?/',
'[[$0 | $1img$2vi/$3/0.jpg"$3"]]');
else
include_once('cookbook/swf-sites.php');

This uses the id of the video as the figure caption in the pdf, and
makes it a link to the video. I have tested this and it works for me.
Use of other link effects will take a bit more effort, because we have
to stop wikipublisher putting links into footnotes, which does not
play nicely with floats.

On Dec 5, 10:32 am, "chr.pfeiffer"


<chr.pfeiffer.arc...@googlemail.com> wrote:
> thanks JR,
>
> before i can try your changes, here's answer for youtubes still picture
> handling:
>

> from thumbnail preview image (http://www.longtailvideo.com/support/forums/jw-player/feature-suggest...


>  )
> image as jpg, didn't find png generation
>
> video sourcehttp://www.youtube.com/watch?v=HcKkKsUH4SA
>
> 320x240 imagehttp://img.youtube.com/vi/HcKkKsUH4SA/0.jpg
>

> patternhttp://img.youtube.com/vi/***/0.jpg<http://img.youtube.com/vi/HcKkKsUH4SA/0.jpg>

Reply all
Reply to author
Forward
0 new messages