Class: Pageflow::VideoFile
Constant Summary
OutputSource::STATE_MAPPING
Instance Method Summary
collapse
#output_presences, #output_presences=, #output_present?, #present_outputs
#failed?, #ready?, #retry!, #retryable?
#attachment, #attachment=, #attachment_default_url, #attachment_styles, #attachments_for_export, #basename, #can_upload?, #direct_upload_config, #extension, #failed?, #file_name, #publish!, #ready?, #retryable?, #url
#attachments_for_export, #basename, #cache_key, #can_upload?, #extension, #failed?, #file_name, #file_type, #nested_files, #original_url, #parent_allows_type_for_nesting, #parent_belongs_to_same_entry, #publish!, #ready?, #retry!, #retryable?, #url
Instance Method Details
#attachment_s3_url ⇒ Object
42
43
44
|
# File 'app/models/pageflow/video_file.rb', line 42
def attachment_s3_url
"s3://#{File.join(attachment.bucket_name, attachment.path)}"
end
|
#dash_4k ⇒ Object
70
71
72
|
# File 'app/models/pageflow/video_file.rb', line 70
def dash_4k
ZencoderAttachment.new(self, 'dash/4k/rendition.mpd')
end
|
#dash_fullhd ⇒ Object
74
75
76
|
# File 'app/models/pageflow/video_file.rb', line 74
def dash_fullhd
ZencoderAttachment.new(self, 'dash/fullhd/rendition.mpd')
end
|
#dash_high ⇒ Object
78
79
80
|
# File 'app/models/pageflow/video_file.rb', line 78
def dash_high
ZencoderAttachment.new(self, 'dash/high/rendition.mpd')
end
|
#dash_low ⇒ Object
86
87
88
|
# File 'app/models/pageflow/video_file.rb', line 86
def dash_low
ZencoderAttachment.new(self, 'dash/low/rendition.mpd')
end
|
#dash_medium ⇒ Object
82
83
84
|
# File 'app/models/pageflow/video_file.rb', line 82
def dash_medium
ZencoderAttachment.new(self, 'dash/medium/rendition.mpd')
end
|
#dash_playlist ⇒ Object
110
111
112
|
# File 'app/models/pageflow/video_file.rb', line 110
def dash_playlist
ZencoderAttachment.new(self, 'dash/manifest.mpd')
end
|
#encode_highdef? ⇒ Boolean
46
47
48
|
# File 'app/models/pageflow/video_file.rb', line 46
def encode_highdef?
entry.feature_state('highdef_video_encoding')
end
|
#externally_generated_outputs ⇒ Object
144
145
146
147
148
149
150
|
# File 'app/models/pageflow/video_file.rb', line 144
def externally_generated_outputs
if Pageflow.config.zencoder_options[:hls_smil_suffix].present?
%w(hls-playlist)
else
[]
end
end
|
#hls_4k ⇒ Object
106
107
108
|
# File 'app/models/pageflow/video_file.rb', line 106
def hls_4k
ZencoderAttachment.new(self, 'hls-4k.m3u8')
end
|
#hls_fullhd ⇒ Object
102
103
104
|
# File 'app/models/pageflow/video_file.rb', line 102
def hls_fullhd
ZencoderAttachment.new(self, 'hls-fullhd.m3u8')
end
|
#hls_high ⇒ Object
98
99
100
|
# File 'app/models/pageflow/video_file.rb', line 98
def hls_high
ZencoderAttachment.new(self, 'hls-high.m3u8')
end
|
#hls_low ⇒ Object
90
91
92
|
# File 'app/models/pageflow/video_file.rb', line 90
def hls_low
ZencoderAttachment.new(self, 'hls-low.m3u8')
end
|
#hls_medium ⇒ Object
94
95
96
|
# File 'app/models/pageflow/video_file.rb', line 94
def hls_medium
ZencoderAttachment.new(self, 'hls-medium.m3u8')
end
|
152
153
154
155
156
157
158
|
# File 'app/models/pageflow/video_file.rb', line 152
def meta_data_attributes=(attributes)
self.attributes = attributes.symbolize_keys.slice(:format,
:duration_in_ms,
:width,
:height,
:output_presences)
end
|
#mp4_4k ⇒ Object
50
51
52
|
# File 'app/models/pageflow/video_file.rb', line 50
def mp4_4k
ZencoderAttachment.new(self, '4k.mp4')
end
|
#mp4_fullhd ⇒ Object
54
55
56
|
# File 'app/models/pageflow/video_file.rb', line 54
def mp4_fullhd
ZencoderAttachment.new(self, 'fullhd.mp4')
end
|
#mp4_high ⇒ Object
58
59
60
|
# File 'app/models/pageflow/video_file.rb', line 58
def mp4_high
ZencoderAttachment.new(self, 'high.mp4')
end
|
#mp4_low ⇒ Object
66
67
68
|
# File 'app/models/pageflow/video_file.rb', line 66
def mp4_low
ZencoderAttachment.new(self, 'low.mp4')
end
|
#mp4_medium ⇒ Object
62
63
64
|
# File 'app/models/pageflow/video_file.rb', line 62
def mp4_medium
ZencoderAttachment.new(self, 'medium.mp4')
end
|
#output_definition ⇒ Object
#post_process_encoded_files ⇒ Object
160
161
162
163
164
165
|
# File 'app/models/pageflow/video_file.rb', line 160
def post_process_encoded_files
self.thumbnail = URI.parse(zencoder_thumbnail.url(default_protocol: 'https'))
self.poster = URI.parse(zencoder_poster.url(default_protocol: 'https'))
rescue OpenURI::HTTPError
throw(:halt, :pending)
end
|
#smil ⇒ Object
128
129
130
|
# File 'app/models/pageflow/video_file.rb', line 128
def smil
ZencoderAttachment.new(self, 'hls-playlist.smil')
end
|
#thumbnail_url(*args) ⇒ Object
38
39
40
|
# File 'app/models/pageflow/video_file.rb', line 38
def thumbnail_url(*args)
poster.url(*args)
end
|
#zencoder_poster ⇒ Object
136
137
138
|
# File 'app/models/pageflow/video_file.rb', line 136
def zencoder_poster
ZencoderAttachment.new(self, 'poster-{{number}}', format: 'jpg')
end
|
#zencoder_thumbnail ⇒ Object
132
133
134
|
# File 'app/models/pageflow/video_file.rb', line 132
def zencoder_thumbnail
ZencoderAttachment.new(self, 'thumbnail-{{number}}', format: 'jpg')
end
|