Last active
December 30, 2015 15:48
-
-
Save weavermedia/7850235 to your computer and use it in GitHub Desktop.
Serve original video or encoded versions depending on job status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# serve original video or encoded versions if the encoding job is complete | |
# using mutiple sources inside the <video> tag | |
<% orig = upload.direct_upload_url %> | |
<% mp4 = webm = jpg = nil %> | |
<% if upload.encode_is_complete %> | |
<% orig = nil %> | |
<% mp4 = upload.base_url + '.mp4' %> | |
<% webm = upload.base_url + '.webm' %> | |
<% jpg = upload.base_url + '-00001.jpg' %> | |
<% end %> | |
<%= video_tag [mp4, webm, orig], poster: jpg, controls: true, autobuffer: false %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment