Project

swf_file

0.01
No commit activity in last 3 years
No release in over 3 years
Based on the swfutil lib, by Dennis Zhuang, the SWF File is lightweight gem to read swf file headers from within a Ruby application. This gem is fully written in Ruby and is compatible with Ruby v1.8.7 through v1.9.2.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

swf_file¶ ↑

A Ruby Gem based on swfutil lib, by Dennis Zhuang. SWF File is lightweight gem to read swf file headers from within a Ruby application.

Ruby compatibility¶ ↑

Target version: 1.9.2dev Also compatible with: 1.9.1 and 1.8.7

Not tested with versions under 1.8.7. Should you use this lib with other ruby versions, please provide feedback.

Install¶ ↑

gem install swf_file

LICENSE¶ ↑

Please refer to the LICENSE file.

Example¶ ↑

header = SwfFile::FlashFile.header 'clicktag.swf' # load the file
# Access the various header options. Please check the unit tests for more usage examples.
puts header.size
puts header.compressed?
puts header.version
puts header.bit_count
puts header.xmax
puts header.ymax
puts header.width # In pixels
puts header.height # In pixels
puts header.frame_rate
puts header.frame_count
puts header.duration # In milliseconds
puts header.avm_version
puts header.signature
# You can also pass a block to SwfFile::FlashFile.header
puts SwfFile::FlashFile.header 'clicktag.swf' { |h| puts h.duration }
# It's also possible to create instances of SwfFile::FlashFile
swf = SwfFile::FlashFile.new 'clicktag.swf'
swf.header # => SwfHeader class instance equivalent to the return of SwfFile::FlashFile.header(<file>)
swf.header.duration
# Instances of SwfFile::FlashFile also receive blocks
swf.header { |h| h.duration }
# SwfFile::FlashFile instance helper method
swf.compressed? # => Helper method. Effectively it's an alias to same as SwfHeader#compressed?

Issues, improvements, feedback an suggestions¶ ↑

To report issues, please use GitHub’s issue manager (github.com/DBA/swf_file/issues). Meanwhile, feel free to fork the project and submit your modifications.

Should you wish to contact me directly, please use GitHub’s message box or the email available at the Rakefile.

Pending¶ ↑

  • Docs