Hook tested youtube client library to recording api controller. Completes: (VRFS-2030, VRFS-2031, VRFS-2032)
This commit is contained in:
parent
83de0b920e
commit
809e5e7443
|
|
@ -6,10 +6,6 @@ module JamRuby
|
|||
|
||||
validates :client_video_source_id, :presence => true
|
||||
|
||||
def upload_sign(content_md5)
|
||||
|
||||
end
|
||||
|
||||
def self.create_from_video_source(video_source, recording)
|
||||
recorded_video_source = self.new
|
||||
recorded_video_source.recording = recording
|
||||
|
|
|
|||
|
|
@ -214,32 +214,25 @@ class ApiRecordingsController < ApiController
|
|||
|
||||
# POST /api/recordings/:id/videos/:video_id/upload_sign
|
||||
def video_upload_sign
|
||||
render :json => @recorded_video.upload_sign(params[:md5]), :status => 200
|
||||
length = params[:length]
|
||||
@youtube_client.upload_sign(current_user, @recorded_video.url, length)
|
||||
end
|
||||
|
||||
# POST /api/recordings/:id/videos/:video_id/upload_complete
|
||||
def video_upload_start
|
||||
response = {
|
||||
:offset=>0,
|
||||
:length=>0,
|
||||
:status=>200
|
||||
}
|
||||
|
||||
render :json => response, :status => 200
|
||||
length = params[:length]
|
||||
@youtube_client.get_upload_status(current_user, @recorded_video.url, length)
|
||||
end
|
||||
|
||||
# POST /api/recordings/:id/videos/:video_id/upload_complete
|
||||
def video_upload_complete
|
||||
response = {
|
||||
:offset=>0,
|
||||
:length=>0,
|
||||
:status=>200
|
||||
}
|
||||
|
||||
render :json => response, :status => 200
|
||||
if @youtube_client.complete_upload(@recorded_video)
|
||||
render :status => 200
|
||||
else
|
||||
render :status => 422
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def upload_next_part_stream_mix
|
||||
length = params[:length]
|
||||
md5 = params[:md5]
|
||||
|
|
|
|||
Loading…
Reference in New Issue