diff --git a/app/libs/aliyun_vod/service/base.rb b/app/libs/aliyun_vod/service/base.rb index ebbcce694..f10f079b4 100644 --- a/app/libs/aliyun_vod/service/base.rb +++ b/app/libs/aliyun_vod/service/base.rb @@ -23,6 +23,7 @@ module AliyunVod::Service::Base result rescue => ex ::Util.logger_error(ex) + "" #raise AliyunVod::Error, ex.message end diff --git a/app/services/videos/batch_publish_service.rb b/app/services/videos/batch_publish_service.rb index 18fa442d8..022098fd4 100644 --- a/app/services/videos/batch_publish_service.rb +++ b/app/services/videos/batch_publish_service.rb @@ -33,6 +33,9 @@ class Videos::BatchPublishService < ApplicationService code_info = AliyunVod::Service.get_meta_code_info(video.uuid) if code_info.present? && code_info.start_with?('h264', 'h265') 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 AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID) end diff --git a/app/services/videos/dispatch_callback_service.rb b/app/services/videos/dispatch_callback_service.rb index 7d5f239c6..4ff94a1c4 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -18,9 +18,7 @@ class Videos::DispatchCallbackService < ApplicationService video.save! when 'SnapshotComplete' then # 封面截图完成 return if video.cover_url.present? - 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) + video.update!(cover_url: params['CoverUrl']) when 'StreamTranscodeComplete' then # 转码完成 #return if video.play_url.present? video.update!(play_url: params['FileUrl'], transcoded: true)