Skip to content

Instantly share code, notes, and snippets.

@kols
Created October 16, 2011 11:00
Show Gist options
  • Save kols/1290767 to your computer and use it in GitHub Desktop.
Save kols/1290767 to your computer and use it in GitHub Desktop.
Play the flash video loading in your browser using a movie player
#!/usr/bin/env ruby
# Play the flash video loading in your browser using a movie player
PLAYER = 'mplayer -zoom' # your favorite player
def get_flash_file_path
pat = %r(^.*?(\d+).*?(\d+).*$)
`lsof /tmp | grep Flash` =~ pat
pid, fd = $~[1], $~[2]
"/proc/#{pid}/fd/#{fd}"
end
def main
flash_file_path = get_flash_file_path
`#{PLAYER} #{flash_file_path}`
end
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment