# Problem with video uploading

**URL:** <https://www.ruby-forum.com/t/problem-with-video-uploading/147689>\
**Category:** Rails\
**Created:** [September 4, 2008, 9:28am UTC](https://www.ruby-forum.com/t/problem-with-video-uploading/147689 "2008-09-04T09:28:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rizwana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a698b9/32.png) [@rizwana](https://www.ruby-forum.com/u/rizwana)\
**Post date:** [September 4, 2008, 9:28am UTC](https://www.ruby-forum.com/t/problem-with-video-uploading/147689/1 "2008-09-04T09:28:42Z")

</div>

Hi all,  
Hope u all are doing well.  
I am supposed to build a website using Ruby on Rails in which the user  
should be able to upload his/her video to YouTube via a form in my  
application. I have no idea how to use Youtube API in Ruby on Rails. I  
have the client ID and developer\_key which are useful in Youtube API.  
I do not know which steps must be followed for implementing this.

Hope anyone of u will help me out solving this problem.

Any help would be greatly appreciated.

Thanks…

---

<div class="post-metadata">

**Author:** ![rizwana](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/a698b9/32.png) [@rizwana](https://www.ruby-forum.com/u/rizwana)\
**Post date:** [September 7, 2008, 4:53am UTC](https://www.ruby-forum.com/t/problem-with-video-uploading/147689/2 "2008-09-07T04:53:46Z")

</div>

I can’t help you with using the API. However, I did find this method  
helpful for _displaying_ the videos

def youtube\_video(url, width=600, height=nil)  
height ||= (width\*355/425).floor  
url = url.gsub(‘watch?v=’, ‘v/’)  
“\<object type=“application/x-shockwave-flash” data=  
“#{url}&rel=0” width=”#{width}" height="#{height}"\>\<param name=  
“movie” value="#{url}&rel=0" /\>\<param name=“FlashVars” value=  
“playerMode=embedded” /\>"  
end

The url argument is simply the URL from youtube. This way, the users  
don’t have to use YouTube’s “embed this” text, (which some find  
confusing) and instead I can impose my own parameters such as width/  
height/etc.

I’m sorry I couldn’t help more.
