./lib/example.rb in animoto-1.5.5 vs ./lib/example.rb in animoto-1.5.6

- old
+ new

@@ -1,50 +1,72 @@ #!/usr/bin/env ruby +require 'ruby-debug' require 'animoto/client' include Animoto # Create a new client using our application key and secret client = Client.new("bb0d0e005ac4012dc17712313b013462", "c0fe4cfca8bf544b8d0e687247a600ef55ff82e3") client.endpoint = "https://platform-staging.animoto.com" +#client = Client.new("698dbba063bc012ea77d1231380e2ed9", "fd3dc39b57878951b480db818c2f3c15") +#client.endpoint = "https://platform-sandbox.animoto.com" -custom_footage = Postroll::CustomFootage.new("http://s3-s.animoto.com/Footage/wInVzO78f0SjP1GTFtfPrA/t.mp4") #("http://api.client.java.animoto.s3.amazonaws.com/test_assets/footage.mp4") -#custom_footage.start_time = 2.0 -#custom_footage.duration = 5.0 +custom_footage = Postroll::CustomFootage.new("http://s3-s.animoto.com/Footage/wInVzO78f0SjP1GTFtfPrA/t.mp4?v=animotopro") +#custom_footage = Postroll::CustomFootage.new("http://s3-s.animoto.com/Footage/wInVzO78f0SjP1GTFtfPrA/t.mp4") + +custom_footage = Postroll::CustomFootage.new("http://api.client.java.animoto.s3.amazonaws.com/test_assets/footage.mp4") +custom_footage.start_time = 2.0 +custom_footage.duration = 3.0 + + +#application_data = {'application_data' => ['title', 'id', 'kind', 'type']} + +#{'partner_metadata' => ['partner_user_id', 'commercial_use', 'partner_intent', application_data]} + +app = {'title' => 'hello', 'id' => 'asdf', 'kind' => 'my', 'type' => 'video'} + +metadata = {'partner_user_id' => '234', 'commercial_use' => 'our wish', 'partner_intent' => 'business', 'application_data' => app} + # create a directing and rendering manifest with the video title and # producer. Also include rendering parameters like resolution, framerate, # and format. manifest = Manifests::DirectingAndRendering.new( :title => "Amazing Venus3!", :resolution => "360p", :style => "original", :pacing => "fast", :framerate => 24, :format => 'h264', + :partner_metadata => metadata, :postroll => custom_footage ) +id = { "partner_user_id" => "42-24010"} + # Add some images, text, and footage to our manifest. img1 = Assets::Image.new("http://cdn.toucharcade.com/wp-content/uploads/2012/12/hac1.jpg") #img1.cover = "Doctorine of pace" #img1.rotation = 2 #img1.spotlit = true -#img1.caption = "Birds can't walk" +img1.caption = "Birds can't walk" img2 = Assets::Image.new("http://api.client.java.animoto.s3.amazonaws.com/test_assets/image.jpg") img3 = Assets::Image.new("http://blogs.independent.co.uk/wp-content/uploads/2012/12/some-girls-300x225.jpg") card1 = Assets::TitleCard.new("f1", "01234567890123456789") +card2 = Assets::TitleCard.new("f1", "012sssh 256789") +card3 = Assets::TitleCard.new("f1", "01234333333") +footage1 = Assets::Footage.new("http://s3-s.animoto.com/Footage/wInVzO78f0SjP1GTFtfPrA/t.mp4") - manifest << img1 manifest << card1 -#manifest << img2 -#manifest << img3 -#manifest << card2 -#manifest << card3 +manifest << img2 +manifest << img3 +manifest << card2 +manifest << card3 +manifest << footage1 # Setup the soundtrack. manifest << Assets::Song.new("http://api.client.java.animoto.s3.amazonaws.com/test_assets/song.mp3", :artist => "Fishy Joe")