Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_video
杨树林 5 years ago
commit 2172d2c531

@ -45,9 +45,9 @@ module AliyunVod::Service::VideoManage
VideoId: video_id,
StartTime: start_time,
EndTime: end_time,
Interval: 'day'
}.merge(base_params)
puts params
result = request(:post, params)
result

@ -0,0 +1,5 @@
class AddPlayUrlToVideos < ActiveRecord::Migration[5.2]
def change
add_column :videos, :play_url, :string
end
end

@ -33,8 +33,8 @@ namespace :video do
task :sample => :environment do
if ENV['args']
video_id = ENV['args'].split(",")[0]
start_time = ENV['args'].split(",")[1].to_s.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') # 表示参与人数
end_time = ENV['args'].split(",")[2].to_s.to_time.utc.strftime('%Y-%m-%dT%H:%M:%SZ') # 表示通过人数
start_time = ENV['args'].split(",")[1].to_s.to_time.utc.iso8601 # 表示开始时间
end_time = ENV['args'].split(",")[2].to_s.to_time.utc.iso8601 # 表示结束时间
video=Video.find video_id
data = AliyunVod::Service.video_data(video.uuid, start_time, end_time)
@ -42,4 +42,21 @@ namespace :video do
puts data
end
end
task :get_play_url => :environment do
Video.all.each do |video|
if video.uuid.present?
end
result = AliyunVod::Service.get_play_info(video.uuid) rescue nil
if result.present? && result["PlayInfoList"]["PlayInfo"].present?
puts result
play_url = result["PlayInfoList"]["PlayInfo"].first["PlayURL"]
puts play_url
# play_url = (result.dig('PlayInfoList', 'PlayInfo') || []).first&.[]('PlayURL')
video.update!(play_url: play_url) if play_url.present?
end
end
end
end

@ -88,3 +88,9 @@
color: #fff;
}
}
.monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input,
.monaco-editor .margin,
.minimap .minimap-decorations-layer{
background-color: transparent !important;
}
Loading…
Cancel
Save