diff --git a/app/services/videos/batch_publish_service.rb b/app/services/videos/batch_publish_service.rb index 7349799c9..207fbdf56 100644 --- a/app/services/videos/batch_publish_service.rb +++ b/app/services/videos/batch_publish_service.rb @@ -30,8 +30,10 @@ class Videos::BatchPublishService < ApplicationService end # 标清转码为h264 - if AliyunVod::Service.get_meta_code_info(video.uuid).start_with?('h264', 'h265', 'flv') + if AliyunVod::Service.get_meta_code_info(video.uuid).start_with?('h264', 'h265') video.transcoded = true + result = AliyunVod::Service.get_play_info(video.uuid) + video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] 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 e81a52d3a..149009c96 100644 --- a/app/services/videos/dispatch_callback_service.rb +++ b/app/services/videos/dispatch_callback_service.rb @@ -15,7 +15,6 @@ class Videos::DispatchCallbackService < ApplicationService video.file_url = convert_https(params['FileUrl']) video.filesize = params['Size'] video.upload_success - video.play_url = video.file_url if video.transcoded #不需要转码时,则统一播放地址 video.save! when 'SnapshotComplete' then # 封面截图完成 return if video.cover_url.present?