Created
October 16, 2011 11:00
-
-
Save kols/1290767 to your computer and use it in GitHub Desktop.
Play the flash video loading in your browser using a movie player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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