Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

Need Help For Project

Hello everyone,

I'm currently in the process of undertaking a pretty big project in my opinion and I need help. I'm wanting to make a rails app in which you can sign in, and watch certain YouTube videos where you left off, kind of like the Netflix website. I'm not sure if the Netflix API can already achieve this. I would also want a way to watch multiple videos at once and some visual way of showing where they are at in the video, again like Netflix. I am a beginner and any help or instructions would be greatly appreciated.

Thanks so much.

1 Answer

Raouf,

Is your question if the Netflix API can support picking up where you left off for videos? From the sound of what you said you are trying to do it seems as though the Youtube API would need to support that, not the Netflix API. I briefly looked through the Youtube API and did not find that value.

Take a look at this link for a Youtube video:

https://www.youtube.com/watch?v=TzEEgtOFFlM#t=181

If you start watching the video, on Facebook for instance, and then click the "Youtube" button on the bottom right it brings you to Youtube with the timestamp of when you left off in seconds. In the above example that is the t anchor that has a value of 181. You could store this locally and queue up the video when the user comes back at that time instead of setting that with the Youtube API. You could add another attribute on to the video when you store the reference to it. Something like amount_of_seconds_to_start_at or something of that nature. Then when you queue that video up again you pass that parameter to the video on playback and it could work. I am not sure exactly of your options when accessing the video from the API but I believe it would work.

If you have more specific questions (your questions seemed quite broad) I'd be happy to help.

The Youtube documentation is the best place to start. Post any questions you may have about reading it. I am not sure of your experience level and I am happy to help.