I am attempting to embed SWFs from external news sites inline (currently without swfobject because I thought that might be complicating things, but I would love to use that if it's working with emfield). Unfortunately, the embedded videos only work on the first page load, and then disappear. I am using an input filter that allows the object element, and this is on emfield 6.x-1.25 since Custom URL support seems to have disappeared in 2.x.

I believe this is the same problem as one previously discussed in #524410: Embedded Inline Media , but that issue strayed into several different topics and was closed without this particular problem having been addressed, so I thought it made sense to create a new issue. From the original issue:

@henrrrik (link)

How is this supposed to work? It only fires with hook_filter on the first node view, on subsequent views the JavaScript doesn't get included any more and the embed stops working.

@aaron (link)

@henrrrik: good point; it doesn't work w/ js + swfobject. only works w/ straight object embeds. not sure if there's going to be a way to fix that.

@zoo33 (link)

WRT henrrrik's and aaron's comments above, I think it would be possible to solve the issue with a hook_nodeapi() implementation. Meta code:

eminline_nodeapi() {
  switch ($op) {
    case 'view':
      if (eminline_needs_swfobject($node->content)) {
        drupal_add_js('swfobject.js');
      }
      break;
  }
}

eminline_needs_swfobject() is a function that would have to be developed. Also, this only deals with nodes. A similar solution would have to be implemented for blocks/boxes I guess. Also, the field in question may be shown by Views without the node necessarily being viewed as a whole.

Is this problem solveable? I would love for this to work.