Class: Pageflow::VideoFile
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Pageflow::VideoFile
- Includes:
- EncodedFileStateMachine, UploadedFile
- Defined in:
- app/models/pageflow/video_file.rb
Instance Method Summary collapse
- #attachment ⇒ Object
- #attachment=(value) ⇒ Object
- #attachment_s3_url ⇒ Object
- #hls_high ⇒ Object
- #hls_low ⇒ Object
- #hls_medium ⇒ Object
- #hls_playlist ⇒ Object
- #meta_data_attributes=(attributes) ⇒ Object
- #mp4_high ⇒ Object
- #mp4_low ⇒ Object
- #mp4_medium ⇒ Object
- #output_definition ⇒ Object
- #smil ⇒ Object
- #webm_high ⇒ Object
- #webm_medium ⇒ Object
- #zencoder_poster ⇒ Object
- #zencoder_thumbnail ⇒ Object
Methods included from UploadedFile
Instance Method Details
#attachment ⇒ Object
51 52 53 |
# File 'app/models/pageflow/video_file.rb', line 51 def .present? ? : end |
#attachment=(value) ⇒ Object
55 56 57 |
# File 'app/models/pageflow/video_file.rb', line 55 def (value) self. = value end |
#attachment_s3_url ⇒ Object
59 60 61 |
# File 'app/models/pageflow/video_file.rb', line 59 def "s3://#{File.join(.bucket_name, .path)}" end |
#hls_high ⇒ Object
94 95 96 |
# File 'app/models/pageflow/video_file.rb', line 94 def hls_high ZencoderAttachment.new(self, "hls-high.m3u8") end |
#hls_low ⇒ Object
86 87 88 |
# File 'app/models/pageflow/video_file.rb', line 86 def hls_low ZencoderAttachment.new(self, "hls-low.m3u8") end |
#hls_medium ⇒ Object
90 91 92 |
# File 'app/models/pageflow/video_file.rb', line 90 def hls_medium ZencoderAttachment.new(self, "hls-medium.m3u8") end |
#hls_playlist ⇒ Object
100 101 102 103 104 105 106 |
# File 'app/models/pageflow/video_file.rb', line 100 def hls_playlist if Pageflow.config.[:hls_smil_suffix].present? ZencoderAttachment.new(self, "hls-playlist.smil", :host => :hls, :url_suffix => Pageflow.config.[:hls_smil_suffix]) else ZencoderAttachment.new(self, "hls-playlist.m3u8", :host => :hls) end end |
#meta_data_attributes=(attributes) ⇒ Object
124 125 126 |
# File 'app/models/pageflow/video_file.rb', line 124 def (attributes) self.attributes = attributes.symbolize_keys.slice(:format, :duration_in_ms, :width, :height) end |
#mp4_high ⇒ Object
73 74 75 |
# File 'app/models/pageflow/video_file.rb', line 73 def mp4_high ZencoderAttachment.new(self, "high.mp4") end |
#mp4_low ⇒ Object
81 82 83 |
# File 'app/models/pageflow/video_file.rb', line 81 def mp4_low ZencoderAttachment.new(self, "low.mp4") end |
#mp4_medium ⇒ Object
77 78 79 |
# File 'app/models/pageflow/video_file.rb', line 77 def mp4_medium ZencoderAttachment.new(self, "medium.mp4") end |
#output_definition ⇒ Object
120 121 122 |
# File 'app/models/pageflow/video_file.rb', line 120 def output_definition ZencoderVideoOutputDefinition.new(self) end |
#smil ⇒ Object
108 109 110 |
# File 'app/models/pageflow/video_file.rb', line 108 def smil ZencoderAttachment.new(self, "hls-playlist.smil") end |
#webm_high ⇒ Object
64 65 66 |
# File 'app/models/pageflow/video_file.rb', line 64 def webm_high ZencoderAttachment.new(self, "high.webm") end |
#webm_medium ⇒ Object
68 69 70 |
# File 'app/models/pageflow/video_file.rb', line 68 def webm_medium ZencoderAttachment.new(self, "medium.webm") end |
#zencoder_poster ⇒ Object
116 117 118 |
# File 'app/models/pageflow/video_file.rb', line 116 def zencoder_poster ZencoderAttachment.new(self, "poster-{{number}}", :format => 'jpg') end |
#zencoder_thumbnail ⇒ Object
112 113 114 |
# File 'app/models/pageflow/video_file.rb', line 112 def zencoder_thumbnail ZencoderAttachment.new(self, "thumbnail-{{number}}", :format => 'jpg') end |