上传视频问题

courseware
daiao 5 years ago
parent 221e7ed1f0
commit 2a258ac9fb

@ -33,10 +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
#Rails.logger.info("####video.uuid:#{video.uuid}") result = AliyunVod::Service.get_play_info(video.uuid) rescue nil
#result = AliyunVod::Service.get_play_info(video.uuid) play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] if result
# Rails.logger.info("####video.result:#{result}") video.play_url = play_url
#video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL']
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)

@ -4,4 +4,4 @@ You are allowed to:
1. Remove rake task 1. Remove rake task
2. Add existing rake tasks 2. Add existing rake tasks
To add existing rake tasks automatically delete this file and reload the project. To add existing rake tasks automatically delete this file and reload the project.
--><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build gitlab-3.2.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Build and install gitlab-3.2.0.gem into system gems" fullCmd="install" taksId="install" /><RakeTask description="Create tag v3.2.0 and build and push gitlab-3.2.0.gem to Rubygems" fullCmd="release" taksId="release" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /></RakeGroup></Settings> --><RakeGroup description="" fullCmd="" taksId="rake"><RakeTask description="Build gitlab-3.2.0.gem into the pkg directory" fullCmd="build" taksId="build" /><RakeTask description="Remove any temporary products" fullCmd="clean" taksId="clean" /><RakeTask description="Remove any generated files" fullCmd="clobber" taksId="clobber" /><RakeTask description="Build and install gitlab-3.2.0.gem into system gems" fullCmd="install" taksId="install" /><RakeGroup description="" fullCmd="" taksId="install"><RakeTask description="Build and install gitlab-3.2.0.gem into system gems without network access" fullCmd="install:local" taksId="local" /></RakeGroup><RakeTask description="Create tag v3.2.0 and build and push gitlab-3.2.0.gem to rubygems.org" fullCmd="release[remote]" taksId="release[remote]" /><RakeTask description="Run RSpec code examples" fullCmd="spec" taksId="spec" /><RakeTask description="" fullCmd="default" taksId="default" /><RakeTask description="" fullCmd="release" taksId="release" /><RakeGroup description="" fullCmd="" taksId="release"><RakeTask description="" fullCmd="release:guard_clean" taksId="guard_clean" /><RakeTask description="" fullCmd="release:rubygem_push" taksId="rubygem_push" /><RakeTask description="" fullCmd="release:source_control_push" taksId="source_control_push" /></RakeGroup></RakeGroup></Settings>

Loading…
Cancel
Save