Programmatically launching standalone Adobe flashplayer on Linux/X11

10,388

Solution 1

You can use a dedicated application which sends the keystroke to the window manager, which should then pass it to flash, if the window starts as being the active window on the screen. This is quite error prone, though, due to delays between starting flash and when the window will show up.

For example, your script could do something like this: flashplayer *.swf sleep 3 && xsendkey Control+F

The application xsendkey can be found here: http://people.csail.mit.edu/adonovan/hacks/xsendkey.html Without given a specific window, it will send it to the root window, which is handled by your window manager. You could also try to figure out the Window id first, using xprop or something related to it.

Another option is a Window manager, which is able to remember your settings and automatically apply them. Fluxbos for example provides this feature. You could set fluxbox to make the Window decor-less and stretch it over the whole screen, if flashplayer supports being resized. This is also not-so-nice, as it would probably affect all the flashplayer windows you open ever.

Solution 2

I've actually done this a long time ago, but it wasn't petty. What we did is use the Sawfish window manager and wrote a hook to recognize the flashplayer window, then strip all the decorations and snap it full screen.

This may be possible without using the window manager, by registering for X window creation events from an external application, but I'm not familiar enough with X11 to tell you how that would be done.

Another option would be to write a pygtk application that embedded the standalone flash player inside a gtk.Socket and then resized itself. After a bit of thought, this might be your best bet.

Solution 3

Another option would be to write a pygtk application that embedded the standalone flash player inside a gtk.Socket and then resized itself. After a bit of thought, this might be your best bet.

This is exactly what I did. In addition to that, my player scales flash content via Xcomposite, Xfixes and Cairo. A .deb including python source be found here: http://www.crutzi.info/crutziplayer

Share:
10,388
Aaron
Author by

Aaron

iOS Developer

Updated on June 28, 2022

Comments

  • Aaron
    Aaron almost 2 years

    The standalone flashplayer takes no arguments other than a .swf file when you launch it from the command line. I need the player to go full screen, no window borders and such. This can be accomplished by hitting ctrl+f once the program has started. I want to do this programmatically as I need it to launch into full screen without any human interaction.

    My guess is that I need to some how get a handle to the window and then send it an event that looks like the "ctrl+f" keystroke.

    If it makes any difference, it looks like flashplayer is a gtk application and I have python with pygtk installed.

    UPDATE (the solution I used... thanks to ypnos' answer):

    ./flashplayer http://example.com/example.swf & sleep 3 && ~/xsendkey -window "Adobe Flash Player 10" Control+F
    
  • Aaron
    Aaron over 15 years
    xprop + xsendkey does the trick. I will post my exact bash command once I get it all the piping and awk stuff figured out to automate it.
  • Aaron
    Aaron about 15 years
    ./flashplayer example.com/example.swf & sleep 3 && ~/xsendkey -window "Adobe Flash Player 10" Control+F
  • Jim
    Jim almost 13 years
    +1 Perfect answer. For those having trouble compiling the xsendkey: gcc -o xsendkey -lX11 xsendkey.c