Method: Yt::Models::Account#upload_video
- Defined in:
- lib/yt/models/account.rb
#upload_video(path_or_url, params = {}) ⇒ Yt::Models::Video
Uploads a video to the account’s channel.
76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/yt/models/account.rb', line 76 def upload_video(path_or_url, params = {}) file = URI.open(path_or_url) session = resumable_sessions.insert file.size, upload_body(params) session.update(body: file) do |data| Yt::Video.new( id: data['id'], snippet: data['snippet'], status: data['status'], auth: self ) end end |