When posting a YouTube video, an tag is generated:
http://www.oniva.com/upload/1356/fb10.jpg
http://www.oniva.com/upload/1356/fb12.jpg
A video get embed in the posting like this:
http://www.oniva.com/upload/1356/fb13.jpg
But when I reading the same page in Facebook using D4FB, I cannot see the video, since Facebook disallow the tag (no video show up in facebook)
http://www.oniva.com/upload/1356/fb14.jpg
When in facebook, I can only add video using like this:
http://www.oniva.com/upload/1356/fb4.jpg
Similarly, inside Drupal web site, I cannot see the video as Drupal not support
Is there any way I can post either in Durpal or Facebook some video content, and both site can see the video content?
I think I need to modify source code in Durpal for Facebook to change all tag to ?
If source code need to change, which part in Durpal for Facebook I should looking into?
Thanks again!
Comments
Comment #1
Dave Cohen commentedThis is a tricky issue. I can suggest two approaches and I'd like to hear what anyone thinks.
First approach, use an input filter. I believe there's at least one input filter designed for youtube videos. This can be made to work because the input filter parses what the node author types, and generates the embed tag based on that. Still this is tricky. The input filter (or more likely filters, one for html another for FBML) needs to generate different markup depending on the context. Also, if the result of the input filter is cached, that could cause problems. So either the filter has to avoid being cached, or you have to set up two filter cache tables (one for html and another for fbml).
The second approach is to run a regular expression pattern replacement over the page (or just node body) before it is written by the theme. In this case it's theme-specific so you need not worry about caches, etc. But the drawback is that it adds overhead to each page request (for that theme). So in your FBML theme you could convert regular HTML embed tags into FBML. Right now, the fb_fbml theme does some regexp search and replace. Grep for fb_canvas_process to see what I'm talking about. The regexps are relatively simple, as I'm trying to avoid demanding too much overhead. I tried to avoid entirely the need to do this, but I found no other reliable way to ensure canvas page links work properly.
I'm on the fence as to which is the better approach. But I will say if anyone has the fortitude to start as FBML input filter with the smarts to convert any HTML into FBML, I'll check it into fb_canvas.module, with the hopes that it will expand to support a wide variety of tags.
Finally, I'll say that I don't consider this a bug per se in these modules. The same problem affects nodes displayed in any format other than HTML. Some tags do not work well when nodes are rendered to RSS feeds, other XML formats, PDF, etc... It's a problem around displaying content in multiple formats, not specifically FBML.
Comment #2
Letharion commentedSince Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 issues. Issues that haven't moved since D5 are unlikely to still be valid.