视频问题

courseware
daiao 5 years ago
parent a1521276ed
commit df6496556b

@ -23,6 +23,7 @@ module AliyunVod::Service::Base
result result
rescue => ex rescue => ex
::Util.logger_error(ex) ::Util.logger_error(ex)
""
#raise AliyunVod::Error, ex.message #raise AliyunVod::Error, ex.message
end end

@ -33,6 +33,9 @@ class Videos::BatchPublishService < ApplicationService
code_info = AliyunVod::Service.get_meta_code_info(video.uuid) code_info = AliyunVod::Service.get_meta_code_info(video.uuid)
if code_info.present? && code_info.start_with?('h264', 'h265') if code_info.present? && code_info.start_with?('h264', 'h265')
video.transcoded = true video.transcoded = true
result = AliyunVod::Service.get_play_info(video.uuid) rescue nil
play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] if result.present?
video.play_url = play_url
else else
AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID) AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID)
end end

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

Loading…
Cancel
Save