[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

[ANN] Flash/Ruby 0.1.0

leon breedt

1/16/2005 9:11:00 AM

Hello,

I'm happy to announce the first public release of Flash/Ruby.
Flash/Ruby is a Ruby extension wrapping a library I wrote called
"libflash" [1].

The "libflash" library provides a way to embed Macromedia (R) Flash
playback in a GTK+ application. It does this by using the Mozilla
plugin and providing a Mozilla emulation layer, much like Konqueror
does, but now you can use it in any application.

The extension's API is quite small, here is roughly all you need to do:

swfplugin = Flash::Library.new('/path/to/libflashplayer.so')
swffile = Flash::File.new(swfplugin, '/path/to/swffile.swf')
window = Gtk::Window.new(Gtk::Window::TOPLEVEL)
window.show
swffile.play(window)
swffile.pause
swffile.resume
...
Gtk::main

As the Flash plugin uses an Xt timer callback to render its frames,
and libflash integrates this with the GLib mainloop, anything that
blocks the GLib mainloop is going to block Flash playback as well. It
should interoperate decently with standard Gtk using apps though.

Dependencies:
libflash 0.99.2 or newer
ruby-gnome2 0.11.0 or newer

The ruby-gnome2 dependency comes about because of a really ugly hack
that I want to alleviate in the future. (The hack lets you pass a
Gtk::Window to swffile.play).

I haven't gotten round to setting up a RubyForge project yet, so...

Download:
http://blog.xeraph.org/software/flash-ruby/flash-ruby-0....


Leon

[1] http://blog.xeraph.org/blog/libflash-0...


3 Answers

Zach Dennis

1/17/2005 5:44:00 PM

0

Has this been tested on win32 at all?

Zach


leon breedt

1/17/2005 8:46:00 PM

0

On Tue, 18 Jan 2005 02:43:48 +0900, Zach Dennis <zdennis@mktec.com> wrote:
> Has this been tested on win32 at all?
No, sorry :(

On Win32 you can embed the Flash ActiveX object which gives you more
functionality, so it wasn't a priority to support Win32 for me. I
don't think I use anything UNIX-specific in libflash though, so if you
can get libflash working on Win32, the bindings should work.

I've only tested on Linux though.

Leon


leon breedt

1/17/2005 8:48:00 PM

0

On Tue, 18 Jan 2005 09:46:08 +1300, leon breedt <bitserf@gmail.com> wrote:
> I don't think I use anything UNIX-specific in libflash though, so if you
> can get libflash working on Win32, the bindings should work.
Woops, scratch that, I just realized there are some things that are
rather X11 specific in my code. UNIX-only I'm afraid at this time.

I'll accept patches to do ActiveX embedding in libflash on Win32 though :)

Leon