How To Make a YouTube Video App – Ep 10 – YouTube Data API, Alamofire

[ad_1]
How to Make a YouTube Video App
Lesson 10
In this series, I’ll show you guys how to build a video app that plays YouTube videos!

In this video, we start on the dynamic version of the YouTube Video App! We sign up for the YouTube Data API to get our credentials and we also use CocoaPods to install the AlamoFire library which is going to help us with the networking involved in the upcoming lessons.

Related Videos and links:

Xcode project, source code and video download:

YouTube Data API Getting Started:

AlamoFire on GitHub:

My API Key:

The How To Make a YouTube Video App Playlist:

The Start Here Series Playlist:

I actually built this app for myself about a year ago and it was built with Objective-C but we’re going to build it again using Swift together.

You’ll learn how to use a tableview (like a scrollable list), display custom table cells, slide out menu, display images, embed and play YouTube videos, navigate between two screens and more!

Warning:
It’s going to be a little challenging for those who are completely new to iPhone app development so I recommend that you watch my “How To Make An iPhone App With No Programming Experience” series of videos first. That playlist is 17 lessons long but it’ll give you the foundation and explain the terminology and object oriented programming concepts that I’m going to be using in the building of this YouTube Video App.

That playlist can be found on my site here:

For more tutorials on how to build iPhone apps, make sure you subscribe and visit my site where you’ll find a community of like minded learners! Learning something new is always more fun with other people!

Youtube:
Website:

CodeWithChris is dedicated to teaching beginners and non-programmers all about building iOS apps. On the site, you’ll find a ton of free resources and tutorials to aid you on your journey to learn iOS development. Many people have successfully picked up Swift, Objective-C, Xcode and app building from my course and materials!

Intro & Outro music
“Heartbreaker” by Jahzzar (


Posted

in

by

Tags:

Comments

10 responses to “How To Make a YouTube Video App – Ep 10 – YouTube Data API, Alamofire”

  1. Dan Haddock Avatar

    How would I go about using the YouTube API outside of XCode?

    I am hoping to integrate with a twitterbot.

    Hope to get a response, I will be hacking away at this this weekend.

  2. Abdul Qadar Avatar

    I am unable to download the source code of this project @Chris ??

  3. Abdallah Sultan Avatar

    could you update it soon ? thank you in advance 🙂

  4. محمد فلاحة Avatar

    please help me
    I am making app to view video youtube api in swift3 xcode8
    like this:

    import UIKit

    import Alamofire

    protocol VideoModelDelegate {
    func dataReady()
    }
    class VideoModel: NSObject {

    let API_KEY = "???????????????????????????"

    let UPLOADS_PLAYLIST_ID = "UUFeUyPY6W8qX8w2o6oSiRmw"

    let urlString = "https://www.googleapis.com/youtube/v3/playlistItems"

    var videoArray = [Video]()

    var delegate:VideoModelDelegate?

    func getFeedVideos(){

    //fetch the videos dynamically through the YouTube Data API
    Alamofire.request((urlString), method: .get, parameters: ["part":"snippet", "playlistId": UPLOADS_PLAYLIST_ID,"key": API_KEY, "maxResults": "50"], encoding: JSONEncoding.default).responseJSON { (response) in

    if let JSON = response.result.value as? [String : Any]{

    var arrayOfVideos = [Video]()

    for video in JSON["items"] as! NSArray{
    //print(video)

    //create video objs off of JSON response
    let videoObj = Video()
    videoObj.videoId = (video as AnyObject).value(forKeyPath: "snippet.resourceId.videoId") as! String
    videoObj.videoTitle = (video as AnyObject).value(forKeyPath: "snippet.title") as! String
    videoObj.videoDescription = (video as AnyObject).value(forKeyPath: "snippet.description") as! String
    videoObj.videoThumbnailURL = (video as AnyObject).value(forKeyPath: "snippet.thumbnails.high.url") as! String
    arrayOfVideos.append(videoObj)
    }

    //assign the array to the video model property
    self.videoArray = arrayOfVideos

    //notify delegate that data is ready
    if self.delegate != nil{
    self.delegate!.dataReady()
    }
    }
    }
    }

    but the code did not work
    the videos did not view in table view
    how can i fix it?
    please help me as you can

  5. Sergey Didanov Avatar

    Hi, How can I get api key for each user, that installed my app? I have already implemented Google authentication in my app.

  6. Andrew Ng Avatar

    Yeahhh! Thanks for making this! 😀 Hey how come you don't have a Udemy Course?

  7. Freddy Joan Torres Brandy Avatar

    Who on this planet who manages to start building apps (no programming experience required) do not have a google account ?

  8. Bart Tas Avatar

    you are incredible with your Youtube video's Thanks!!!!

  9. Bart Tas Avatar

    The error I get is "Thread 1: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" at the line "for video in JSON["items"] as! NSARRAY {
    print(video)"

  10. Bart Tas Avatar

    hello Chris, I have a problem with episode 10 of making a youtubeApp! I have make an API key and instal Alamofire but at the moment you get print(video) and run the Build i have a error

Leave a Reply

Your email address will not be published. Required fields are marked *