处理非转码视频播放地址

newyslclassrooms
anke1460 5 years ago
parent 65761f15f5
commit 487a9c3a8c

@ -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

@ -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?

Loading…
Cancel
Save