|  |  |  | @ -29,13 +29,14 @@ class Videos::BatchPublishService < ApplicationService | 
			
		
	
		
			
				
					|  |  |  |  |           video.status = "published" | 
			
		
	
		
			
				
					|  |  |  |  |         end | 
			
		
	
		
			
				
					|  |  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |  |         # 标清转码为h264 | 
			
		
	
		
			
				
					|  |  |  |  |         if AliyunVod::Service.get_meta_code_info(video.uuid).start_with?('h264', 'h265') | 
			
		
	
		
			
				
					|  |  |  |  |         #  非MP4 H264编码的都转码 | 
			
		
	
		
			
				
					|  |  |  |  |         code_info = AliyunVod::Service.get_meta_code_info(video.uuid) | 
			
		
	
		
			
				
					|  |  |  |  |         Rails.logger.info("code_info: #{code_info[:format]}, #{code_info[:codecnamne]}") | 
			
		
	
		
			
				
					|  |  |  |  |         if code_info[:format] == "mp4" && code_info[:codecnamne].present? && code_info[:codecnamne].start_with?('h264') | 
			
		
	
		
			
				
					|  |  |  |  |           video.transcoded = true | 
			
		
	
		
			
				
					|  |  |  |  |           #Rails.logger.info("####video.uuid:#{video.uuid}") | 
			
		
	
		
			
				
					|  |  |  |  |           #result = AliyunVod::Service.get_play_info(video.uuid) | 
			
		
	
		
			
				
					|  |  |  |  |          # Rails.logger.info("####video.result:#{result}") | 
			
		
	
		
			
				
					|  |  |  |  |           #video.play_url = result['PlayInfoList']['PlayInfo'][0]['PlayURL'] | 
			
		
	
		
			
				
					|  |  |  |  |           result = AliyunVod::Service.get_play_info(video.uuid) rescue nil | 
			
		
	
		
			
				
					|  |  |  |  |           play_url = result['PlayInfoList']['PlayInfo'].first['PlayURL'] if result.present? | 
			
		
	
		
			
				
					|  |  |  |  |           video.play_url = play_url | 
			
		
	
		
			
				
					|  |  |  |  |         else | 
			
		
	
		
			
				
					|  |  |  |  |           AliyunVod::Service.submit_transcode_job(video.uuid, Video::NORMAL_TRANSCODE_GROUP_ID) | 
			
		
	
		
			
				
					|  |  |  |  |         end | 
			
		
	
	
		
			
				
					|  |  |  | 
 |