0

I'm new with activeadmin and have searched everywhere for a solution to my problem. I'm building a subscription based site and paying customers will have access to the videos. I'm using Activeadmin but am having trouble with coding S3 within my app so I can use it in my Activeadmin dashboard. I was able to find coding for Wistia and it works perfectly - but haven't found anything with Amazon S3. Here is my apps->views->tasks->show.html.erb

show.html.erb

Any help would be awesome! Thanks so much!

TheoNov18
  • 13
  • 3
  • Is your question about having the videos displayed in ActiveAdmin from S3, or is your question that you want videos uploaded to go to S3? – bwalshy Aug 15 '18 at 03:17
  • Videos displayed in ActiveAdmin from S3. Is there any way I can embed them (eg in the body) within ActiveAdmin? – TheoNov18 Aug 15 '18 at 05:45

1 Answers1

0

I haven't done it but I believe you can use the HTML5 video tag and an S3 signed URL. I'm guessing it would look something like:

aws_resource = Aws::S3::Resource.new(credentials: credentials)
presigner = Aws::S3::Presigner.new(client: aws_resource.client)
video(width: 320, height: 240) do
  source(src: presigner.presigned_url(:get_object, bucket: bucket_name, key: file.key))
end

There are also third party solutions you might look at like Flowplayer and Foliovision

Piers C
  • 2,880
  • 1
  • 23
  • 29