View Full Version : Getting embedded Flash filename

08-28-2009, 06:10 PM
Anybody know how to get the name of a Flash (.flv) file from a downloaded object/embed code - when that code is loaded into an iframe? I'm referring to msnbc.com specifically: their video embeds use iframes (presumably to jam a viewport in everyone's client), and the iframe document spits out the proper object/embed element, generated via JS. You can view the filename via a FireFox extension or a DOM viewer, but I need to get it programmatically so the process can be automated (for non-techy users). Loading the url in a dummy iframe and attempting to parse the source violates same source restrictions. Would appreciate any suggestions!

09-05-2009, 05:25 AM
::: bump :::

09-05-2009, 05:34 AM
user firebug

09-06-2009, 10:32 PM
Thanks ... that would be OK if the user - the poster who wished to embed the video in their response - had Firebug installed, or another Firefox utility which allowed them to read the filename. Problem is, I was hoping to automate the process, letting users run a favelet which would parse the embedding code (the one wrapped in the IFRAME, which the site's backend filters out) and get the .flv filename and insert it into a standard embedding "sandwich" (<object>..<embed>..</embed>..</object>) which could be added to the rest of the post. A standard third-party Flash player will be called to display the clip. Presumably this would all be done with JavaScript, regular expressions doing the parse/replace chores - bu JS can't simply read the filename from the IFRAME's document source (which appears to be generated by JavaScript as well) because of security restrictions. Here's a sample of the MSNBC embedding code that I need to eliminate the IFRAME from:

<div><iframe height="339" width="425" src="http://www.msnbc.msn.com/id/22425001/vp/32697037#32697037" frameborder="0" scrolling="no"></iframe><p style="font-size:11px; font-family:Arial, Helvetica, sans-serif; color: #999; margin-top: 5px; background: transparent; text-align: center; width: 425px;">Visit msnbc.com for <a style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;" href="http://www.msnbc.msn.com">Breaking News</a>, <a href="http://www.msnbc.msn.com/id/3032507" style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;">World News</a>, and <a href="http://www.msnbc.msn.com/id/3032072" style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;">News about the Economy</a></p></div>

... and here's a sample of the JS in the served IFRAME document (view source on this):


Nothing illicit going on here, just trying to bypass MSNBC's seizing a viewport on everyone's page instead of just making the object available for viewing ...