smeeb
smeeb

Reputation: 29567

Livestreaming or uploading videos to YouTube API without exposing credentials

I'm building an Android/iOS (using Angular/Ionic/Cordova under the hood) app where I'd like any user to be able to record a video and:

So basically I'm trying to allow my app's backend to offer private video hosting/viewing but without having to solve video hosting myself, and to use YouTube as the video store instead.

My requirement for the videos to be private/unviewable from outside my app is not a hard requirement, just preferred if at all possible. My app architecture will be the following:

Things I'm not too concerned about:

But what I'm hung up on is:

How to allow my end users (in my app) to specify livestream vs bulk upload mode (I assume this is a config setting inside the YouTube API client) and then actually upload them to YouTube without exposing the channel's access/credential info to the end user.

I'm actually using Ionic/Cordova under the hood so if there's a library to help manage API integration and livestream/upload of videos that would be great but I didn't see any.

Upvotes: 4

Views: 1314

Answers (1)

Tyler
Tyler

Reputation: 3836

Authentication & Credentials

It would likely make more sense and certainly be more within YouTube's guidelines to rely on your users to have their own YouTube account. With this method you would not need to worry about securing your own account's credentials and as an added bonus you can use Google authentication instead of building your own authentication backend.

Content Management

Instead of uploading all videos to your personal account, you can instead attach all of your user-submitted videos to a playlist and link the videos to your app that way. This would again allow you to utilize your users' credentials instead of your own and would fall inline with the YouTube API's intended use case.

Streaming vs. Bulk Uploading

YouTube already has an API built to handle streaming videos and an API for uploading a saved video. You can give your users either option in your app.

Bonus Round

Here are the Ionic plugins for the Cordova video player and native camera.

Upvotes: 4

Related Questions