-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathread me
More file actions
24 lines (14 loc) · 883 Bytes
/
read me
File metadata and controls
24 lines (14 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Add gem in Gemgile
gem "paperclip"
gem "jw_player_helper"
Add following validation on Model . here i recomended Product.rb
has_attached_file :video, :styles => { :small => '94x58#',:medium => '188x116#', :large => '376x232#' },
:url => "/assets/posts/:id/:style/:basename.:extension",
:path => ":rails_root/public/assets/posts/:id/:style/:basename.:extension"
validates_attachment_presence :video
validates_attachment_size :video, :less_than => 100.megabytes
validates_attachment_content_type :video, :content_type => ['video/mp4', 'video/flv','video/3gp']
Add Javascript in Application.html.erb
<%= javascript_include_tag 'swfobject' %>
On show.html.erb I play video, So that add a line here with video_play tag
<%= video_player({:file => @product.video.url, :mute => true}, {:width => 440, :height => 300}) %>