0

我目前有一个基于 Rails 的站点,它托管在 Heroku 上,允许用户上传个人图像和视频。我目前将它们存储在 S3 上,视频编码由 Zencoder 完成。到目前为止,我对此非常满意,但是我想使用 Cloudinary 之类的服务。我创建了一个上传到 Cloudinary 的演示应用程序,并且对它的工作方式非常满意,但是对于视频,这似乎不起作用。我知道 Cloudinary 不进行任何编码,我也不希望他们这样做。我仍将使用 Zencoder,但只想在一个地方存储所有媒体文件。

有没有人使用过这种方法,或者有一些想法可以更好地解决这个问题?

4

1 回答 1

2

Can you please explain what you meant by "this does not seem to be working"? What issues were you experiencing?

You can upload any file type to Cloudinary, not just images. All non-images files, included video files are handled as 'raw' files. Here's an upload example of a WMV file to your Cloudinary account:

Cloudinary::Uploader.upload("sample_video.wmv", :public_id => "sample_video", :resource_type => :raw)

For delivery, the returned public ID of the upload API call should be used. Here's a URL example , notice the '.../raw/upload...' :

http://res.cloudinary.com/demo/raw/upload/sample_video.wmv

For more information: http://cloudinary.com/blog/using_cloudinary_to_manage_all_your_website_s_assets_in_the_cloud

于 2013-05-29T19:45:10.827 回答