With VideoKit, we want to provide you an easy way to play videos from video.io. With this mission in mind, we created
VKPlayerViewController for you to do this.
VKPlayerViewController is fully functional video player with flexible controls, advanced preloading and caching which can play both single video
VKVideo or list of videos
VKPlaylist. There are two common ways you could integrate the player into your app.
Integrating the player into your app is easy through interface builder. Just follow the following steps:
Go to your Storyboard and head to the view you're interested in embedding the player
Add a container view into where you want to embed player.
Enter a segue identifier for the segue. In this case we named it playerSegue
In the linked View Controller to the container please change the type of class from
In your view controller code that contains the embed container view, enter the following code in your
And you can always integrate the player to your app just using code:
If you don't wish to embed the player, you could always present the view controller as so:
Here's some of the main player options you can use to configure player appearance and behavior.
So now when you have the player configured and added into your app now it's time to play a video. If you already have a video you want to play, just do the following:
If you have id of the video you want to play, you can do this:
To play a playlist would look like this:
For more information about
VKPlayerViewController see API reference.