Class: Vimeo::Advanced::Video

Inherits:
Base
  • Object
show all
Defined in:
lib/vimeo/advanced/video.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #login_link, #upload_sig

Constructor Details

This class inherits a constructor from Vimeo::Advanced::Base

Instance Method Details

#add_cast(video_id, user_id, auth_token, options = {}) ⇒ Object



226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/vimeo/advanced/video.rb', line 226

def add_cast(video_id, user_id, auth_token, options={})
  role = options[:role]
  
  sig_options = {
    :video_id => video_id,
    :user_id => user_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.addCast"
  }
  sig_options.merge! :role => role unless role.nil?

  make_request sig_options
end

#add_comment(video_id, comment_text, auth_token, options = {}) ⇒ Object



282
283
284
285
286
287
288
289
290
291
292
293
294
# File 'lib/vimeo/advanced/video.rb', line 282

def add_comment(video_id, comment_text, auth_token, options={})
  reply_to_comment_id = options[:reply_to_comment_id]

  sig_options = {
    :video_id => video_id,
    :comment_text => comment_text,
    :auth_token => auth_token,
    :method => "vimeo.videos.comments.addComment"
  }
  sig_options.merge! :reply_to_comment_id => reply_to_comment_id unless reply_to_comment_id.nil?

  make_request sig_options
end

#add_tags(video_id, tags, auth_token) ⇒ Object



194
195
196
197
198
199
200
201
202
203
# File 'lib/vimeo/advanced/video.rb', line 194

def add_tags(video_id, tags, auth_token)
  sig_options = {
    :video_id => video_id,
    :tags => tags,
    :auth_token => auth_token,
    :method => "vimeo.videos.addTags"
  }

  make_request sig_options
end

#clear_tags(video_id, auth_token) ⇒ Object



216
217
218
219
220
221
222
223
224
# File 'lib/vimeo/advanced/video.rb', line 216

def clear_tags(video_id, auth_token)
  sig_options = {
    :video_id => video_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.clearTags"
  }

  make_request sig_options
end

#delete(video_id, auth_token) ⇒ Object



139
140
141
142
143
144
145
146
147
# File 'lib/vimeo/advanced/video.rb', line 139

def delete(video_id, auth_token)
  sig_options = {
    :video_id => video_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.delete"
  }

  make_request sig_options
end

#delete_comment(video_id, comment_id, auth_token) ⇒ Object



296
297
298
299
300
301
302
303
304
305
# File 'lib/vimeo/advanced/video.rb', line 296

def delete_comment(video_id, comment_id, auth_token)
  sig_options = {
    :video_id => video_id,
    :comment_id => comment_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.comments.deleteComment"
  }

  make_request sig_options
end

#edit_comment(video_id, comment_id, comment_text, auth_token) ⇒ Object



307
308
309
310
311
312
313
314
315
316
317
# File 'lib/vimeo/advanced/video.rb', line 307

def edit_comment(video_id, comment_id, comment_text, auth_token)
  sig_options = {
    :video_id => video_id,
    :comment_id => comment_id,
    :comment_text => comment_text,
    :auth_token => auth_token,
    :method => "vimeo.videos.comments.editComment"
  }

  make_request sig_options
end

#get_appears_in_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/vimeo/advanced/video.rb', line 31

def get_appears_in_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :method => "vimeo.videos.getAppearsInList"
  }
  
  make_request sig_options
end

#get_cast(video_id, auth_token = nil) ⇒ Object



240
241
242
243
244
245
246
247
248
# File 'lib/vimeo/advanced/video.rb', line 240

def get_cast(video_id, auth_token=nil)
  sig_options = {
    :video_id => video_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.getCast"
  }

  make_request sig_options
end

#get_comments_list(video_id) ⇒ Object



273
274
275
276
277
278
279
280
# File 'lib/vimeo/advanced/video.rb', line 273

def get_comments_list(video_id)
  sig_options = {
    :video_id => video_id,
    :method => "vimeo.videos.comments.getList"
  }

  make_request sig_options
end

#get_contacts_like_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



98
99
100
101
102
103
104
105
106
107
108
109
# File 'lib/vimeo/advanced/video.rb', line 98

def get_contacts_like_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getContactsLikeList"
  }

  make_request sig_options
end

#get_contacts_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
# File 'lib/vimeo/advanced/video.rb', line 85

def get_contacts_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getContactsList"
  }

  make_request sig_options
end

#get_info(video_id, auth_token = nil) ⇒ Object



129
130
131
132
133
134
135
136
137
# File 'lib/vimeo/advanced/video.rb', line 129

def get_info(video_id, auth_token=nil)
  sig_options = {
    :video_id => video_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.getInfo"
  }

  make_request sig_options
end

#get_like_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/vimeo/advanced/video.rb', line 72

def get_like_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getLikeList"
  }

  make_request sig_options
end

#get_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0 }) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/vimeo/advanced/video.rb', line 6

def get_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0 })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :method => "vimeo.videos.getList"
  }
  
  make_request sig_options
end

#get_list_by_tag(tag, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/vimeo/advanced/video.rb', line 56

def get_list_by_tag(tag, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  user_id = options[:user_id]

  sig_options = {
    :tag => tag,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getListByTag"
  }
  sig_options.merge! :user_id => user_id if !user_id.nil?

  make_request sig_options
end

#get_subscriptions_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/vimeo/advanced/video.rb', line 43

def get_subscriptions_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getSubscriptionsList"
  }
  
  make_request sig_options
end

#get_thumbnail_url(video_id, size = 100) ⇒ Object



149
150
151
152
153
154
155
156
157
# File 'lib/vimeo/advanced/video.rb', line 149

def get_thumbnail_url(video_id, size=100)
  sig_options = {
    :video_id => video_id,
    :size => size,
    :method => "vimeo.videos.getThumbnailUrl"
  }

  make_request sig_options
end

#get_uploaded_list(user_id, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/vimeo/advanced/video.rb', line 18

def get_uploaded_list(user_id, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  sig_options = {
    :user_id => user_id,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.getUploadedList"
  }
  
  make_request sig_options
end

#remove_cast(video_id, user_id, auth_token) ⇒ Object



250
251
252
253
254
255
256
257
258
259
# File 'lib/vimeo/advanced/video.rb', line 250

def remove_cast(video_id, user_id, auth_token)
  sig_options = {
    :video_id => video_id,
    :user_id => user_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.removeCast"
  }

  make_request sig_options
end

#remove_tag(video_id, tag_id, auth_token) ⇒ Object



205
206
207
208
209
210
211
212
213
214
# File 'lib/vimeo/advanced/video.rb', line 205

def remove_tag(video_id, tag_id, auth_token)
  sig_options = {
    :video_id => video_id,
    :tag_id => tag_id,
    :auth_token => auth_token,
    :method => "vimeo.videos.removeTag"
  }

  make_request sig_options
end

#search(q, options = { :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil }) ⇒ Object



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/vimeo/advanced/video.rb', line 111

def search(q, options={ :page => 1, :per_page => 25, :full_response => 0, :auth_token => nil })
  user_id = options[:user_id]
  contacts_only = options[:contacts_only]

  sig_options = {
    :query => q,
    :page => options[:page],
    :per_page => options[:per_page],
    :fullResponse => options[:full_response],
    :auth_token => options[:auth_token],
    :method => "vimeo.videos.search"
  }
  sig_options.merge! :user_id => user_id if !user_id.nil?
  sig_options.merge! :contacts_only => contacts_only if !contacts_only.nil?

  make_request sig_options
end

#set_caption(video_id, caption, auth_token) ⇒ Object



170
171
172
173
174
175
176
177
178
179
# File 'lib/vimeo/advanced/video.rb', line 170

def set_caption(video_id, caption, auth_token)
  sig_options = {
    :video_id => video_id,
    :caption => caption,
    :auth_token => auth_token,
    :method => "vimeo.videos.setCaption"
  }

  make_request sig_options
end

#set_favorite(video_id, favorite, auth_token) ⇒ Object



181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/vimeo/advanced/video.rb', line 181

def set_favorite(video_id, favorite, auth_token)
  f = favorite ? true : false

  sig_options = {
    :video_id => video_id,
    :favorite => f,
    :auth_token => auth_token,
    :method => "vimeo.videos.setFavorite"
  }

  make_request sig_options
end

#set_privacy(video_id, privacy, auth_token) ⇒ Object

TODO: Add ability to specify users



262
263
264
265
266
267
268
269
270
271
# File 'lib/vimeo/advanced/video.rb', line 262

def set_privacy(video_id, privacy, auth_token)
  sig_options = {
    :video_id => video_id,
    :privacy => privacy,
    :auth_token => auth_token,
    :method => "vimeo.videos.setPrivacy"
  }

  make_request sig_options
end

#set_title(video_id, title, auth_token) ⇒ Object



159
160
161
162
163
164
165
166
167
168
# File 'lib/vimeo/advanced/video.rb', line 159

def set_title(video_id, title, auth_token)
  sig_options = {
    :video_id => video_id,
    :title => title,
    :auth_token => auth_token,
    :method => "vimeo.videos.setTitle"
  }

  make_request sig_options
end