Class: Pageflow::VideoFile
Overview
rubocop:todo Style/Documentation
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
41
42
43
|
# File 'app/models/pageflow/video_file.rb', line 41
def attachment_s3_url
"s3://#{File.join(attachment.bucket_name, attachment.path)}"
end
|
#dash_4k ⇒ Object
69
70
71
|
# File 'app/models/pageflow/video_file.rb', line 69
def dash_4k
ZencoderAttachment.new(self, 'dash/4k/rendition.mpd')
end
|
#dash_fullhd ⇒ Object
73
74
75
|
# File 'app/models/pageflow/video_file.rb', line 73
def dash_fullhd
ZencoderAttachment.new(self, 'dash/fullhd/rendition.mpd')
end
|
#dash_high ⇒ Object
77
78
79
|
# File 'app/models/pageflow/video_file.rb', line 77
def dash_high
ZencoderAttachment.new(self, 'dash/high/rendition.mpd')
end
|
#dash_low ⇒ Object
85
86
87
|
# File 'app/models/pageflow/video_file.rb', line 85
def dash_low
ZencoderAttachment.new(self, 'dash/low/rendition.mpd')
end
|
#dash_medium ⇒ Object
81
82
83
|
# File 'app/models/pageflow/video_file.rb', line 81
def dash_medium
ZencoderAttachment.new(self, 'dash/medium/rendition.mpd')
end
|
#dash_playlist ⇒ Object
109
110
111
|
# File 'app/models/pageflow/video_file.rb', line 109
def dash_playlist
ZencoderAttachment.new(self, 'dash/manifest.mpd')
end
|
#dash_playlist_high_and_up ⇒ Object
113
114
115
|
# File 'app/models/pageflow/video_file.rb', line 113
def dash_playlist_high_and_up
ZencoderAttachment.new(self, 'dash/manifest-high-and-up.mpd')
end
|
#encode_highdef? ⇒ Boolean
45
46
47
|
# File 'app/models/pageflow/video_file.rb', line 45
def encode_highdef?
entry.feature_state('highdef_video_encoding')
end
|
#externally_generated_outputs ⇒ Object
151
152
153
154
155
156
157
|
# File 'app/models/pageflow/video_file.rb', line 151
def externally_generated_outputs
if Pageflow.config.zencoder_options[:hls_smil_suffix].present?
%w[hls-playlist]
else
[]
end
end
|
#hls_4k ⇒ Object
105
106
107
|
# File 'app/models/pageflow/video_file.rb', line 105
def hls_4k
ZencoderAttachment.new(self, 'hls-4k.m3u8')
end
|
#hls_fullhd ⇒ Object
101
102
103
|
# File 'app/models/pageflow/video_file.rb', line 101
def hls_fullhd
ZencoderAttachment.new(self, 'hls-fullhd.m3u8')
end
|
#hls_high ⇒ Object
97
98
99
|
# File 'app/models/pageflow/video_file.rb', line 97
def hls_high
ZencoderAttachment.new(self, 'hls-high.m3u8')
end
|
#hls_low ⇒ Object
89
90
91
|
# File 'app/models/pageflow/video_file.rb', line 89
def hls_low
ZencoderAttachment.new(self, 'hls-low.m3u8')
end
|
#hls_medium ⇒ Object
93
94
95
|
# File 'app/models/pageflow/video_file.rb', line 93
def hls_medium
ZencoderAttachment.new(self, 'hls-medium.m3u8')
end
|
#hls_playlist_high_and_up ⇒ Object
131
132
133
|
# File 'app/models/pageflow/video_file.rb', line 131
def hls_playlist_high_and_up
ZencoderAttachment.new(self, 'hls-playlist-high-and-up.m3u8', host: :hls)
end
|
159
160
161
162
163
164
165
|
# File 'app/models/pageflow/video_file.rb', line 159
def meta_data_attributes=(attributes)
self.attributes = attributes.symbolize_keys.slice(:format,
:duration_in_ms,
:width,
:height,
:output_presences)
end
|
#mp4_4k ⇒ Object
49
50
51
|
# File 'app/models/pageflow/video_file.rb', line 49
def mp4_4k
ZencoderAttachment.new(self, '4k.mp4')
end
|
#mp4_fullhd ⇒ Object
53
54
55
|
# File 'app/models/pageflow/video_file.rb', line 53
def mp4_fullhd
ZencoderAttachment.new(self, 'fullhd.mp4')
end
|
#mp4_high ⇒ Object
57
58
59
|
# File 'app/models/pageflow/video_file.rb', line 57
def mp4_high
ZencoderAttachment.new(self, 'high.mp4')
end
|
#mp4_low ⇒ Object
65
66
67
|
# File 'app/models/pageflow/video_file.rb', line 65
def mp4_low
ZencoderAttachment.new(self, 'low.mp4')
end
|
#mp4_medium ⇒ Object
61
62
63
|
# File 'app/models/pageflow/video_file.rb', line 61
def mp4_medium
ZencoderAttachment.new(self, 'medium.mp4')
end
|
#output_definition ⇒ Object
#post_process_encoded_files ⇒ Object
167
168
169
170
171
172
|
# File 'app/models/pageflow/video_file.rb', line 167
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
135
136
137
|
# File 'app/models/pageflow/video_file.rb', line 135
def smil
ZencoderAttachment.new(self, 'hls-playlist.smil')
end
|
#thumbnail_url ⇒ Object
37
38
39
|
# File 'app/models/pageflow/video_file.rb', line 37
def thumbnail_url(*)
poster.url(*)
end
|
#zencoder_poster ⇒ Object
143
144
145
|
# File 'app/models/pageflow/video_file.rb', line 143
def zencoder_poster
ZencoderAttachment.new(self, 'poster-{{number}}', format: 'jpg')
end
|
#zencoder_thumbnail ⇒ Object
139
140
141
|
# File 'app/models/pageflow/video_file.rb', line 139
def zencoder_thumbnail
ZencoderAttachment.new(self, 'thumbnail-{{number}}', format: 'jpg')
end
|