How To Play a Local Video File in Your App using AVPlayerViewController

[ad_1]
This lesson shows how to play a local video file if you choose to include your video files inside your Xcode project. We’re using AVPlayerViewController

We’re building off of the demo we built where we play a video stream so be sure to check that out too!

Xcode project, source code and video download:

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

11 responses to “How To Play a Local Video File in Your App using AVPlayerViewController”

  1. Oren Edrich Avatar

    Is it possible to have two separate buttons that each play separate video?

  2. Morgan Evans Media Avatar

    Hi Chris! How would I add a second button and have a second video play from that button? Thanks

  3. aras tahiron Avatar

    WHY SWIFT!! WHYYYYYY!!! language complicates me, i just need obj c 😛

  4. gangsterdave2000 Avatar

    hey Chris, I've done this tutorial and the next one, "How to stream a video file". On both, when I click play, nothing happens. No error msg, nothing. The projects build successfully. I have the an AppleTV connected to my Mac. OS is El Capitan 10.11.2 and have xcode 7.3 beta. Tried this on 7.2, same results. Any idea? Thanks man..

  5. Johan Grip Avatar

    Great tutorial! Is it possible to play several local videos after each other, like a playlist? When the first video has finished playing then the second one automatically starts playing, and so on until you press "done".

  6. Tchek02 Avatar

    Was mistaking NSURL(string:) with NSURL(fileURLWithPath:) !! Thank youuuuuu for the tuto !!!

  7. guy cohen Avatar

    Thank you so much 🙂

  8. Tim Cook Avatar

    Can you make a objective-c tut???

Leave a Reply

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