Need help with: Javascript, SWFObject, display flv movie using swf fiel

View: New views
3 Messages — Rating Filter:   Alert me  

Need help with: Javascript, SWFObject, display flv movie using swf fiel

by craiglewiston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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 turbogears@...
To unsubscribe from this group, send email to turbogears+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Need help with: Javascript, SWFObject, display flv movie using swf fiel

by Christopher Arndt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


craig schrieb:
> 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.

Christoph Zwerschke just posted a recipe on the wiki to embed flash
objects into pages with TurboGears widgets:

http://docs.turbogears.org/1.0/RoughDocs/WidgetRecipes#mp3-player-flash-widget

Chris

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


Re: Need help with: Javascript, SWFObject, display flv movie using swf fiel

by craiglewiston :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


thanks!  i was actually the second request that got him to post it.
it's a very useful resource!

-craig

On Sep 28, 9:55 am, Christopher Arndt <chris.ar...@...> wrote:

> craig schrieb:
>
> > 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.
>
> Christoph Zwerschke just posted a recipe on the wiki to embed flash
> objects into pages with TurboGears widgets:
>
> http://docs.turbogears.org/1.0/RoughDocs/WidgetRecipes#mp3-player-fla...
>
> Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to turbogears@...
To unsubscribe from this group, send email to turbogears+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

LightInTheBox - Buy quality products at wholesale price!