Displaying Youtube videos in Safari on an iPhone

akolade - September 3, 2009 - 04:59
Project:Video Filter
Version:6.x-2.5
Component:Code
Category:feature request
Priority:minor
Assigned:Unassigned
Status:needs review
Description

I noticed that Youtube videos won't display when viewed in Safari on the iPhone. After a bit of research it seems that iPhone Safari requires the <embed> tag to properly detect a Youtube clip and replace it with a Thumbnail link to the video.

Thanks to Video Filters themable "theme_video_filter_flash()" function this was an easy fix.

Simply theme the function by copying the source and adding the following line before the closing "</object>" tag gets appended to the output string:

$output = '<embed src="' . $video['source'] . '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="' . $video['width'] . '" height="' .$video['height']. '"></embed>';

This might be something that should be added to a future release?
Note that I have only tested this with Youtube URLs, so there might be problems with other video codecs which use this function, but that seems unlikely.

#1

akolade - September 3, 2009 - 05:01
Assigned to:akolade» Anonymous

#2

blackdog - September 7, 2009 - 16:33

Hey akolade,

Thanks for this, haven't seen it myself. I'll take a look and maybe we can add this in for all codecs.

#3

CinemaSaville - November 4, 2009 - 22:38

Did this ever get implemented in the current module?

#4

blackdog - November 6, 2009 - 13:22

No, it's not been tested yet for all codecs. I'd be happy to have someone test and report, with a patch.

 
 

Drupal is a registered trademark of Dries Buytaert.