问题
I've been asked to integrate videos into an existing app which previously only let users upload posts with images.
I don't want to host the videos on my own server for the following reasons:
- Server Bandwidth
- File Size Limits and Storage Space
- Slow-Loading Video or Unexpected Pauses During Playback
- Issues with converting to specific formats
- Piracy
Based off this article:
https://www.wp101.com/10-reasons-why-you-should-never-host-your-own-videos/
So I tried to research into where I could host the files and then I would simply have to store the URL in my db and use a video player to stream the content.
Vimeo and youtube seemed to be the main options I could find.
I'm wondering how best to implement, would I make use of a youtube API and on successful upload, grab the link and upload to my own server? I'm concerned this may be a long process for the end user.
Another problem is I can't see any swift examples (ZERO obj-c experience) of making the http request but perhaps it is still possible but I'd just have to write the code myself? I'm wondering if anyone has implemented anything like this already as I can't find any examples.
Looking at this question:
How do I upload a video to YouTube from within an iOS application?
None of the links in the comments work and the answer directs to the youtube 2.0 API and I'm concerned that this is now deprecated.
Any advice appreciated!
来源:https://stackoverflow.com/questions/34904374/uploading-a-video-to-youtube-from-my-swift-app