Class: Pageflow::VideoFile

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
EncodedFileStateMachine, UploadedFile
Defined in:
app/models/pageflow/video_file.rb

Instance Method Summary collapse

Methods included from UploadedFile

#usage_id

Instance Method Details

#attachmentObject



51
52
53
# File 'app/models/pageflow/video_file.rb', line 51

def attachment
  attachment_on_s3.present? ? attachment_on_s3 : attachment_on_filesystem
end

#attachment=(value) ⇒ Object



55
56
57
# File 'app/models/pageflow/video_file.rb', line 55

def attachment=(value)
  self.attachment_on_filesystem = value
end

#attachment_s3_urlObject



59
60
61
# File 'app/models/pageflow/video_file.rb', line 59

def attachment_s3_url
  "s3://#{File.join(attachment_on_s3.bucket_name, attachment_on_s3.path)}"
end

#hls_highObject



94
95
96
# File 'app/models/pageflow/video_file.rb', line 94

def hls_high
  ZencoderAttachment.new(self, "hls-high.m3u8")
end

#hls_lowObject



86
87
88
# File 'app/models/pageflow/video_file.rb', line 86

def hls_low
  ZencoderAttachment.new(self, "hls-low.m3u8")
end

#hls_mediumObject



90
91
92
# File 'app/models/pageflow/video_file.rb', line 90

def hls_medium
  ZencoderAttachment.new(self, "hls-medium.m3u8")
end

#hls_playlistObject



100
101
102
103
104
105
106
# File 'app/models/pageflow/video_file.rb', line 100

def hls_playlist
  if Pageflow.config.zencoder_options[:hls_smil_suffix].present?
    ZencoderAttachment.new(self, "hls-playlist.smil", :host => :hls, :url_suffix => Pageflow.config.zencoder_options[: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_highObject



73
74
75
# File 'app/models/pageflow/video_file.rb', line 73

def mp4_high
  ZencoderAttachment.new(self, "high.mp4")
end

#mp4_lowObject



81
82
83
# File 'app/models/pageflow/video_file.rb', line 81

def mp4_low
  ZencoderAttachment.new(self, "low.mp4")
end

#mp4_mediumObject



77
78
79
# File 'app/models/pageflow/video_file.rb', line 77

def mp4_medium
  ZencoderAttachment.new(self, "medium.mp4")
end

#output_definitionObject



120
121
122
# File 'app/models/pageflow/video_file.rb', line 120

def output_definition
  ZencoderVideoOutputDefinition.new(self)
end

#smilObject



108
109
110
# File 'app/models/pageflow/video_file.rb', line 108

def smil
  ZencoderAttachment.new(self, "hls-playlist.smil")
end

#webm_highObject



64
65
66
# File 'app/models/pageflow/video_file.rb', line 64

def webm_high
  ZencoderAttachment.new(self, "high.webm")
end

#webm_mediumObject



68
69
70
# File 'app/models/pageflow/video_file.rb', line 68

def webm_medium
  ZencoderAttachment.new(self, "medium.webm")
end

#zencoder_posterObject



116
117
118
# File 'app/models/pageflow/video_file.rb', line 116

def zencoder_poster
  ZencoderAttachment.new(self, "poster-{{number}}", :format => 'jpg')
end

#zencoder_thumbnailObject



112
113
114
# File 'app/models/pageflow/video_file.rb', line 112

def zencoder_thumbnail
  ZencoderAttachment.new(self, "thumbnail-{{number}}", :format => 'jpg')
end