courseware
daiao 5 years ago
parent 27e10e4173
commit a6507b5036

@ -32,10 +32,10 @@ class Videos::BatchPublishService < ApplicationService
# 标清转码为h264
if AliyunVod::Service.get_meta_code_info(video.uuid).start_with?('h264', 'h265')
video.transcoded = true
Rails.logger.info("####video.uuid:#{video.uuid}")
result = AliyunVod::Service.get_play_info(video.uuid)
Rails.logger.info("####video.result:#{result}")
video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL']
#Rails.logger.info("####video.uuid:#{video.uuid}")
#result = AliyunVod::Service.get_play_info(video.uuid)
# Rails.logger.info("####video.result:#{result}")
#video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL']
else
AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID)
end

@ -18,8 +18,9 @@ class Videos::DispatchCallbackService < ApplicationService
video.save!
when 'SnapshotComplete' then # 封面截图完成
return if video.cover_url.present?
video.update!(cover_url: params['CoverUrl'])
result = AliyunVod::Service.get_play_info(video.uuid) rescue nil
play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] if result
video.update!(cover_url: params['CoverUrl'], play_url: play_url)
when 'StreamTranscodeComplete' then # 转码完成
return if video.play_url.present?
video.update!(play_url: params['FileUrl'], transcoded: true)

Loading…
Cancel
Save