Class YouTubeG::Upload::VideoUpload
In: lib/youtube_g/request/video_upload.rb
Parent: Object

require ‘youtube_g‘

uploader = YouTubeG::Upload::VideoUpload.new("user", "pass", "dev-key") uploader.upload File.open("test.m4v"), :title => ‘test’,

                                       :description => 'cool vid d00d',
                                       :category => 'People',
                                       :keywords => %w[cool blah test]

Methods

new   upload  

Public Class methods

Public Instance methods

Upload "data" to youtube, where data is either an IO object or raw file data. The hash keys for opts (which specify video info) are as follows:

  :mime_type
  :filename
  :title
  :description
  :category
  :keywords
  :private

Specifying :private will make the video private, otherwise it will be public.

When one of the fields is invalid according to YouTube, an UploadError will be returned. Its message contains a list of newline separated errors, containing the key and its error code.

When the authentication credentials are incorrect, an AuthenticationError will be raised.

[Validate]