Class: Pageflow::VideoFile

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

Instance Method Summary collapse

Methods included from EncodedFileStateMachine

#retryable?

Methods included from HostedFile

#attachment, #attachment=, columns, #keep_on_filesystem_after_upload_to_s3?, #retryable?, #url

Methods included from UploadedFile

#usage_id

Instance Method Details

#attachment_s3_urlObject



39
40
41
# File 'app/models/pageflow/video_file.rb', line 39

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

#hls_highObject



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

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

#hls_lowObject



66
67
68
# File 'app/models/pageflow/video_file.rb', line 66

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

#hls_mediumObject



70
71
72
# File 'app/models/pageflow/video_file.rb', line 70

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

#hls_playlistObject



80
81
82
83
84
85
86
# File 'app/models/pageflow/video_file.rb', line 80

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



104
105
106
# File 'app/models/pageflow/video_file.rb', line 104

def (attributes)
  self.attributes = attributes.symbolize_keys.slice(:format, :duration_in_ms, :width, :height)
end

#mp4_highObject



53
54
55
# File 'app/models/pageflow/video_file.rb', line 53

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

#mp4_lowObject



61
62
63
# File 'app/models/pageflow/video_file.rb', line 61

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

#mp4_mediumObject



57
58
59
# File 'app/models/pageflow/video_file.rb', line 57

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

#output_definitionObject



100
101
102
# File 'app/models/pageflow/video_file.rb', line 100

def output_definition
  ZencoderVideoOutputDefinition.new(self)
end

#smilObject



88
89
90
# File 'app/models/pageflow/video_file.rb', line 88

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

#thumbnail_url(*args) ⇒ Object



35
36
37
# File 'app/models/pageflow/video_file.rb', line 35

def thumbnail_url(*args)
  poster.url(*args)
end

#webm_highObject



44
45
46
# File 'app/models/pageflow/video_file.rb', line 44

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

#webm_mediumObject



48
49
50
# File 'app/models/pageflow/video_file.rb', line 48

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

#zencoder_posterObject



96
97
98
# File 'app/models/pageflow/video_file.rb', line 96

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

#zencoder_thumbnailObject



92
93
94
# File 'app/models/pageflow/video_file.rb', line 92

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