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


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

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

#hls_highObject


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

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

#hls_lowObject


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

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

#hls_mediumObject


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

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

#hls_playlistObject


76
77
78
79
80
81
82
# File 'app/models/pageflow/video_file.rb', line 76

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


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

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

#mp4_highObject


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

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

#mp4_lowObject


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

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

#mp4_mediumObject


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

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

#output_definitionObject


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

def output_definition
  ZencoderVideoOutputDefinition.new(self)
end

#smilObject


84
85
86
# File 'app/models/pageflow/video_file.rb', line 84

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

#thumbnail_url(*args) ⇒ Object


31
32
33
# File 'app/models/pageflow/video_file.rb', line 31

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

#webm_highObject


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

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

#webm_mediumObject


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

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

#zencoder_posterObject


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

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

#zencoder_thumbnailObject


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

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