I just started developing with TurboGears last week, and am trying to
create a page that grabs a .flv video filename from a database and
displays that video within an .swf file.  I'm trying to use FlowPlayer
(http://flowplayer.org/) for my .swf file player.

Here is the basic code I have in my controllers.py:

static_dir = pkg_resources.resource_filename('tg', 'static')
register_static_directory('tg', static_dir)
vp_frame = widgets.Widget()
vp_frame.javascript.append(JSLink('tg', 'static/javascript/
swfobject.js'))
vp_frame.javascript.append(JSSource('swfobject.embedSWF("/static/
FlowPlayerClassics.swf", "player", "800", "600", "9.0.0", false,
flashvars, params, attributes);', location=js_location.head))

within the controller method for the page, I then send the object
"vp_frame" over to the template:

data = {'vp_frame':vp_frame}
return data

When I load up the template page, I see that the javascript is
generated in the header correctly:

<script src="/tg_widgets/tg/static/javascript/swfobject.js" type="text/
javascript"></script>
<script type="text/javascript">swfobject.embedSWF("/static/
FlowPlayerClassics.swf", "player", "800", "600", "9.0.0", false,
flashvars, params, attributes);</script>

however, in the <div> tag labelled "player", nothing shows up.  The
second line of javascript is supposed to embed the swf video player
within the "player" <div> tag (or at least I think it is), but no
luck.

Any advice?

Thanks in advance,
Craig

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to