rubymotion-community / BubbleWrap

Cocoa wrappers and helpers for RubyMotion (Ruby for iOS and OS X) - Making Cocoa APIs more Ruby like, one API at a time. Fork away and send your pull requests
Other
1.18k stars 208 forks source link

Convert video to base64 #479

Closed hugoerg56 closed 8 years ago

hugoerg56 commented 8 years ago

How can get a video with the BW::Device.camera and convert that file on a base64 string?

Any idea?

hugoerg56 commented 8 years ago
BW::Device.camera.rear.picture(media_types: [:movie]) do |result|
  data = NSData.dataWithContentsOfURL(result[:media_url])
  filebase64 = data.base64Encoding
end

This is, thanks!