Documentation

Classes

VKAccount
Expand all / Collapse all

This class provides access to the account.

Static Properties

currentVKAccountVKAccount
Current app reference. Use it to manage VKit session and observe VKit state.

Properties

appIDStringNSString
The application id that is assigned to you by V.
authTokenStringNSString
The authorization token that is assigned to you by V.
appSecretTokenStringNSString
The application secret token is assigned to you by V.
secureModeEnabledBoolBOOL
Allows client to start session using appSecretToken. Be careful only for testing purposes.
accountStateVKAccountState
This describes the current account state of the session. A VKNotificationConstants.AccountStateChanged is sent when state are changed.
errorErrorNSError
This is the error that may have occured while trying to start a session. This is not nil if accountState == .disconnected

Methods

func startSession(completion: (VKAccountState, Error?) -> Void)- (void)startSession
Starts the session. You could check on the state of session via accountState. Ensure authToken and appID are filled.
Copy
public func startSession(completion: (VKAccountState, Error?) -> Void)
- (void)startSession:(void (^ _Nullable)(enum VKAccountState accountState, NSError * _Nullable err))completion
Arguments
completion

(accountState: VKAccountState, err: Error?) -> Void(^)(enum VKAccountState accountState, NSError * _Nullable err) *required

Account completions block
func stopSession()- (void)stopSession
Stops the session. You could check on the state of the session via accountState.
Copy
public func stopSession()
- (void)stopSession

VKVideoStore
Expand all / Collapse all

This is a video store class that contains all your repository of videos. Use this class to query and delete videos. Do not make an instance as everything in this class are class properties and class methods.

Static Properties

sharedVKVideoStoreVKVideoStore
Video store shared instance.

Methods

class func getVideoPlaylist- (void)getVideoPlaylist
Requests video playlist by passed tags, metadata and order
Copy
public func getVideoPlaylist(withTags tags: Set<String>, withMetadata metadata: [String : String], withOrder order: String, completion: (VKVideoPlaylist?, Error?) -> Void)
- (void)getVideoPlaylistWithTags:(NSSet<NSString *> * _Nonnull)tags withMetadata:(NSDictionary<NSString *, NSString *> * _Nonnull)metadata withOrder:(NSString)order completion:(void (^)(VKVideoPlaylist *, NSError *))completion
Arguments
tags

Set<String>NSSet<NSString *> *required

Set of string tags to search for. Must not be nil but could be empty.
metadata

[String : String]NSDictionary<NSString *, NSString *> *required

Metadata dictionary to search for. Must not be nil but could be empty.
order

StringNSString *

Value indicates the order of sorting videos in playlist (asc or desc). Default - desc.
completion

(VKVideoPlaylist?, Error?) -> Void(^)(VKVideoPlaylist * _Nullable, NSError * _Nullable) *required

Completion block to be called when the playlist is returned. If the call was successful then a VKVideoPlaylist is returned. Else nil is returned with an error included.
class func getVideos- (void)getVideos
Requests videos by passed video ids
Copy
public func getVideos(ids: [String], completion: ([VKVideoObject]?, Error?) -> Void)
- (void)getVideos:(NSArray<NSString *> * _Nonnull)ids completion:(void (^)(NSArray<VKVideoObject *> *, NSError *))completion
Arguments
ids

[String]NSArray<NSString *> *required

List of video ids
completion

([VKVideoObject]?, Error?) -> Void(^)(NSArray<VKVideoObject *> * _Nullable, NSError * _Nullable) *required

This is the completion block to be called when the videos are returned. If the call was successful then a array of VKVideoObject is returned. Else nil is returned with an error included.
class func getVideo- (void)getVideo
Requests video by passed video id
Copy
public func getVideo(id: String, completion: (VKVideoObject?, Error?) -> Void)
- (void)getVideos:(NSString * _Nonnull)id completion:(void (^)(VKVideoObject *, NSError *))completion
Arguments
id

StringNSString * *required

Video id
completion

(VKVideoObject?, Error?) -> Void(^)(VKVideoObject * _Nullable, NSError * _Nullable) *required

This is the completion block to be called when the video is returned. If the call was successful then a VKVideoObject is returned. Else nil is returned with an error included.
class func removeVideo- (void)removeVideo
Removes video from the store
Copy
public func removeVideo(id: String)
- (void)removeVideo:(NSString * _Nonnull)id
Arguments
id

StringNSString * *required

Video id to remove

VKVideoPlaylist
Expand all / Collapse all

This class represents a playlist of videos.

Properties

tagsSet<String>NSSet<NSString *>
The tags that defines this playlist
metadata[String : String]NSDictionary<NSString *, NSString *>
The metadata that defines this playlist.
countIntNSInteger
The total number of videos that's in this playlist. This property can be observed through KVO.

Methods

func itemAtIndex- (void)itemAtIndex
Returns the video object at index
Copy
public func itemAtIndex(index: Int, completion: (VKVideoObject?, Error?) -> Void)
- (void)itemAtIndex:(NSInteger)index completion:(void (^ _Nonnull)(VKVideoObject * _Nullable, NSError * _Nullable))completion
Arguments
index

IntNSInteger *required

The index item to request.
completion

(VKVideoObject?, Error?) -> Void(^)(VKVideoObject * _Nullable) *required

The completion block to be called when the item is returned, will be called with video if it exist or error if something went wrong
func itemAtIndexCached- (void)itemAtIndexCached
Returns the video object from cache at index
Copy
public func itemAtIndexCached(index: Int) -> VKVideoObject?
- (VKVideoObject?)itemAtIndex:(NSInteger)index
Arguments
index

IntNSInteger *required

The index item to request.
func sync- (void)sync
Sync server changes of playlist to client.
Copy
public func sync(completion: @escaping (_ success: Bool) -> Void)
- (void)syncWithCompletion: (void (^)(BOOL))completion
Arguments
completion

(_ success: Bool) -> Void(^)(BOOL success) *required

the completion block to be called sync finished, passed success to param.

VKVideoObject
Expand all / Collapse all

This class represents a video object.

Properties

idStringNSString
The unique ID identifying this video.
titleStringNSString
The title of this video.
tagsSet<String>NSSet<NSString *>
The tags that describes this video.
metadata[String : String]NSDictionary<NSString *, NSString *>
The metadata that describes this video.
widthIntNSInteger
The width of this video.
heightIntNSInteger
The height of this video.
durationTimeInterval?NSTimeInterval?
The length of this video in seconds.
locationCLLocation
The geolocation to which this video was taken.
lowMP4UrlURLNSURL
The url to low quality mp4 file for this video.
mediumMP4UrlURLNSURL
The url to medium quality mp4 file for this video.
highMP4UrlURLNSURL
The url to high quality mp4 file for this video.
posterImageUrlURL?NSURL * _Nullable
The poster image URL for this video.
subtitlesUrlURL?NSURL * _Nullable
The WebVTT subtitles URL for this video.
liveStreamUrlURL?NSURL * _Nullable
The live stream url for this video.
isLiveBoolBOOL
The flag indicating whether this video live or not.
videoAnalysisVKVideoAnalysis?VKVideoAnalysis * _Nullable
The video analysis object for this video
createdAtDateNSDate
The creation date of this video.
shotOnDateNSDate
The shot date of this video.

VKVideoAnalysis
Expand all / Collapse all

This class represents an analysis of video content using deep learning algorithms.

Properties

descriptionString? NSString * _Nullable
General video description.
classifiedVideoUrlURL?NSURL * _Nullable
The video url with classification labels on top of recognized objects.
classifications[VKVideoClassification]?NSArray<VKVideoClassification *> * _Nullable
List of classification objects in the video
transcriptionString?NSString * _Nullable
Transcription of recognized speech in the video
transcriptionParts[VKTranscriptionPart]?NSArray<VKTranscriptionPart *> * _Nullable
List of transcription parts recognized in speech of the video
inappropriateContentBoolBOOL
The flag indicating whether the video contains inappropriate content

VKVideoClassification
Expand all / Collapse all

This class represents a classification of object detected in a video using deep learning algorithms.

Properties

titleStringNSString
Classification title
startTimeTimeIntervalNSTimeInterval
The time the classified object appears in the video.
endTimeTimeIntervalNSTimeInterval
The time the classified object disappears in the video.
positionMap[TimeInterval: CGRect]NSDictionary<NSTimeInterval *, CGRect *>
Position map of classified object, represents map of time to rect area where classified object was located at corresponding time

VKTranscriptionPart
Expand all / Collapse all

This class represents a part of video transcription.

Properties

textStringNSString
Text of transcription part
startTimeTimeIntervalNSTimeInterval
The time when transcription part has started in the video.
endTimeTimeIntervalNSTimeInterval
The time when transcription part has ended in the video.

VKPlayersManager
Expand all / Collapse all

This class represents a players manager for convenient preloading and prerendering of videos for custom playback experience. To make it works you only need to pass list of video ids in an order you're going to play it in your interface and keep it in actual state using addVideoIds and removeVideoIds methods. After that you only need to call getPlayerFor with video id to get prepared video player instance as you need to show or play it.

Methods

init(prerenderDistance: Int, preloadDistance: Int)- initWithPrerenderDistance
Initilize new instance.
Copy
public init(prerenderDistance: Int = 5, preloadDistance: Int = 10)
- (void)initWithPrerenderDistance:(NSInteger * _Nullable)prerenderDistance preloadDistance:(NSInteger * _Nullable)preloadDistance
Arguments
prerenderDistance

IntNSInteger

Amount of players that will be used for pre rendering of videos closest to the current video. Default value is 5
preloadDistance

IntNSInteger

Amount of videos closest to the current video, which should be preloaded. Default value is 10
func addVideoIds([String], at: Int)- addVideoIds
Adds new video ids to manager to specified position.
Copy
public func addVideoIds(_ videoIds: [String], at index: Int = -1)
- (void)addVideoIds:(NSArray<NSString *> * _Nonnull)videoIds at index:(NSInteger * _Nullable)index
Arguments
videoIds

[String]NSArray<NSString *> *required

List of video ids you want to add to manager
at

IntNSInteger

Position where you want to add new videos. Default value is -1 (end of list)
func removeVideoIds([String])- removeVideoIds
Removes passed video ids.
Copy
public func removeVideoIds(_ videoIds: [String])
- (void)addVideoIds:(NSArray<NSString *> * _Nonnull)videoIds
Arguments
videoIds

[String]NSArray<NSString *> *required

List of video ids you want to remove from manager
func reset()- reset
Reset manager to initial state.
Copy
public func reset()
- (void)reset
func getPlayerFor(videoId: String) -> VKPlayerViewController- getPlayerFor
Returns prepared video player for passed video id.
Copy
public func getPlayerFor(videoId: String) -> VKPlayerViewController
- (VKPlayerViewController)getPlayerFor:(NSString * _Nonnull)videoId
Arguments
videoId

StringNSString *required

Id of video you need a player for
Return
VKPlayerViewController - Prepared video player instance

VKVideoUploadsManager
Expand all / Collapse all

This is a video uploading manager class that contains information about currently uploading videos and provides ability to cancel any of them.

Static Properties

sharedVKVideoUploadsManagerVKVideoUploadsManager
Shared instance of video uploads manager.

Properties

uploads[VKVideoUpload]NSArray<VKVideoUpload *> * _Nonnull
List of active video upload objects. KVO observable.

Methods

func cancelUploadingFor(videoId: String)- (void)cancelUploadingForVideoId
Cancels video uploading
Copy
public func cancelUploadingFor(videoId: String)
- (void)cancelUploadingForVideoId:(NSString * _Nonnull)videoId
Arguments
id

StringNSString * *required

Id of video to cancel uploading for

VKVideoUpload
Expand all / Collapse all

This class contains information about video upload.

Properties

videoIdStringNSString
Id of the uploading video
videoPosterImageUIImage?UIImage * _Nullable
Poster image of the uploading video
progressFloatfloat
Progress of the video uploading (from 0 to 1)
isCompressedBoolBOOL
The flag indicating whether the uploading video is already compress and ready for upload or it's compressing. This flag is relevant only for videos imported from user photo library, which should be compressed before uploading to the server.

Views

VKPlayerViewController
Expand all / Collapse all

Standard player view controller to which you play videos from V.

Properties

delegateVKPlayerViewProtocol
The delegate for which the player would call.
showControlsBoolBOOL
Enable the showing of controls. Default value is true.
showSpinnerBoolBOOL
Enable the showing of spinner on video loading and buffering. Default value is true.
showErrorMessagesBoolBOOL
Enable the showing of user-readable error messages if video playback failed. Default value is true.
showSubtitlesBoolBOOL
Enable the showing of auto generated subtitles. Default value is false.
mutedBoolBOOL
Enable audio mute. Default value is false.
aspectModeVKAspectMode
The current aspect mode the player is in. Default avalue is VKAspectMode.resizeAspect
playStateVKPlayState
Indicates the current state of the player. This property is read only and can be observed via KVO.
currentPositionTimeIntervalNSTimeInterval
Indicates the current time position of the player. This property is read only and can be observed via KVO.
durationTimeIntervalNSTimeInterval
The duration of the current playing item. If there's no item to be played the value is 0.
currentPlaylistVKVideoPlaylist
Indicates the current playlist of the player if you use playlist for playback. This property is read only and can be observed via KVO.
currentVideoVKVideoObject
Indicates the current video of the player. This property is read only and can be observed via KVO.
currentIndexIntNSInteger
Indicates the playlist index of current video in the player if you use playlist for playback. This property is read only and can be observed via KVO.

Methods

func reset()- (void)reset
Reset player to initial state.
Copy
public func reset()
- (void)reset
func setTo(video: VKVideoObject)- (void)setTo
Sets the player to a particular video object without playing it just yet. It will begin to preload the video.
Copy
public func setTo(video: VKVideoObject)
- (void)setTo:(VKVideoObject * _Nonnull)video
Arguments
video

VKVideoObject *required

The video object to be set.
func setTo(playlist: VKVideoPlaylist, atIndex: Int)- (void)setTo
Sets the player to a particular playlist object without playing it just yet. It will begin to preload the video.
Copy
open func setTo(playlist: VKVideoPlaylist, atIndex index: Int)
- (void)setTo:(VKVideoPlaylist * _Nonnull)playlist atIndex index:(NSInteger)index;
Arguments
playlist

VKVideoPlaylist *required

The playlist object that you want to set.
index

IntNSInteger *required

The index position that you would want to set withing the playlist.
func setTo(index: Int)- (void)setTo
Sets the player's current playlist index to specified value without playing it just yet. It will begin to preload the video.
Copy
open func setTo(index: Int)
- (void)setTo:(NSInteger)index;
Arguments
index

IntNSInteger *required

The index position that you would want to set withing the playlist.
func setTo(videoId: String, nextVideoIds: [String] = [])- (void)setTo
Sets the player to a particular video without playing it just yet. It will begin to preload the video and next videos one by one.
Copy
open func setTo(videoId: String, nextVideoIds: [String] = [])
- (void)setTo:(NSString * _Nonnull)videoId nextVideoIds:(NSArray<NSString *>)nextVideoIds;
Arguments
videoId

StringNSString *required

Identifier of video to set to.
nextVideoIds

[String]NSArray<NSString *>

List of video ids to preload for further playback. Videos will be preloaded one by one in accordance with order in this array, so you should order them accordingly. Maximum amount of videos to preload is 10, 2 first videos from the list will also be prerendered for instant playback on switch.
func playVideo(video: VKVideoObject)- (void)playVideo
Plays the video object.
Copy
public func playVideo(video: VKVideoObject)
- (void)playVideo:(VKVideoObject * _Nonnull)video
Arguments
video

VKVideoObject *required

The video object to be played.
func playVideo(playlist: VKVideoPlaylist, index: Int)- (void)playVideo
Plays the video playlist object.
Copy
open func playVideo(playlist: VKVideoPlaylist, index: Int)
- (void)playVideo:(VKVideoPlaylist * _Nonnull)playlist index:(NSInteger)index;
Arguments
playlist

VKVideoPlaylist *required

The playlist object that you want to play.
index

IntNSInteger *required

The index position that you would want to play withing the playlist.
func playVideo(atIndex: Int)- (void)playVideo
Plays a video object at specified index of the current playlist.
Copy
open func playVideo(atIndex: Int)
- (void)playVideo:(NSInteger)atIndex;
Arguments
index

IntNSInteger *required

The index position that you would want to play withing the playlist.
func playVideo(videoId: String, nextVideoIds: [String] = [])- (void)playVideo
Plays the video object specified by id. When playback of specified video is started, it will begin to preload the next videos one by one.
Copy
open func playVideo(videoId: String, nextVideoIds: [String] = [])
- (void)playVideo:(NSString * _Nonnull)videoId nextVideoIds:(NSArray<NSString *>)nextVideoIds;
Arguments
videoId

StringNSString *required

Identifier of video to play.
nextVideoIds

[String]NSArray<NSString *>

List of video ids to preload for further playback. Videos will be preloaded one by one in accordance with order in this array, so you should order them accordingly. Maximum amount of videos to preload is 10, 2 first videos from the list will also be prerendered for instant playback on switch.
func play()- (void)play
Play the current item.
Copy
public func play()
- (void)play
func pause()- (void)pause
Pause the current item.
Copy
public func pause()
- (void)pause
func seekToPosition(TimeInterval)- (void)seekToPosition
Move the current play position to a different time position.
Copy
public func seekToPosition(_ time: TimeInterval)
- (void)seekToPosition:(NSTimeInterval)time
Arguments
time

TimeIntervalNSTimeInterval *required

The time position to move to.

VKRecorderViewController
Expand all / Collapse all

Recorder view controller that provides a facility to record video to be stored on video.io.
It works in 2 ways, with standart controls (set showControls to true(default value), the easiest way to utilize recorder) and with capture view only(set showControls to false, advanced recording, you can add custom controls as you wish).
You can set showControls property only and only if recordState is ready.
Preview feature is not available in case of controls is hidden, but you can implement it on your side.
Subscribe VKNotificationConstants.VideoIsRecordered notification, it contains local recordered video files, you can use it to built your preview control.
Finally make sure that either recorder.confirmRecording() or recorder.cancelRecording() is called when you don't need video file anymore.
Recorder support scanning qr data which should be instance of [String : Any] class. QR code should contains tags, metadata, title, appId keys. QR code scanning feature could be disabled by setting property qrScanningEnabled to false.
QR code tags key represents tags of newly created video object. See property tags. Type - [String].
QR code metadata key represents metadata of newly created video object. See property metadata. Type - [String : String].
QR code title key represents title can be seen at the upper part of recorder. See property recorderTitle. Attention, it doesn't affect recorderd video object. Type - String.
QR code appId key indicates app videos should relate to. If value of appId differs from VKAccount.appID that QR code will be ignored. Type - String.

Properties

delegateVKRecorderViewProtocol
The delegate to be called by the recorder.
tags[String]NSArray<NSString *>
Tags of newly created video.
metadata[String : String]NSDictionary<NSString *, NSString *>
Metadata of newly created video.
recorderTitleStringNSString
Recorder title. Could be changed by scanning QR, `title` key. KVO observable.
showControlsBoolBOOL
Indicates whether standart UI will be shown or not. Can be set only when recordState == .ready. Default is true.
qrScanningEnabledBoolBOOL
Indicates should recorder support scanning QR code. Default is true.
torchAvailableBoolBOOL
Indicates whether torch is available. KVO observable.
torchEnabledBoolBOOL
Indicates whether torch is enabled now. Default is false.
zoomFactorFloat
Current device zoom factor.
recordCaptureRatioVKRecordCaptureRatio
The current aspect mode the player is in. Default is VKRecordCaptureRatio.widescreen
captureTypeVKCaptureType
Indicates the capture device that it will record from. KVO Observable.
recordStateVKRecordState
The current state of the of the recorder. KVO Observable.
currentVideoObjectVKVideoObject?VKVideoObject * _Nullable
The video object of the recording.

Methods

func startRecording()- (void)startRecording
Start recording video or continues if paused.
Copy
public func startRecording()
- (void)startRecording
func pauseRecording()- (void)pauseRecording
Pause the current recording. Can only be called after recordState becomes is recording.
Copy
public func pauseRecording()
- (void)pauseRecording
func completeRecording()- (void)completeRecording
Complete the recording. Can only be called after recordState becomes is recording.
Copy
public func completeRecording()
- (void)completeRecording
func cutRecordingPart(from: TimeInterval, to: TimeInterval) -> Bool- (BOOL)cutRecordingPart
Cuts part of recording in accordance with passed interval. Should be called after completeRecording is called and before new recording had been started.
Copy
public func cutRecordingPart(from: TimeInterval, to: TimeInterval) -> Bool
- (BOOL)cutRecordingPartFrom:(NSTimeInterval * _Nonnull)from to:(NSTimeInterval * _Nonnull)to
Arguments
from

TimeIntervalNSTimeInterval *required

Start time of the recording part that you want to cut
to

TimeIntervalNSTimeInterval *required

End time of the recording part that you want to cut
Return
BoolBOOL - Result of operation
func moveRecordingPart(from: TimeInterval, to: TimeInterval, newPosition: TimeInterval) -> Bool- (BOOL)moveRecordingPart
Moves part of recording in accordance with passed interval to new position. Should be called after completeRecording is called and before new recording had been started.
Copy
public func moveRecordingPart(from: TimeInterval, to: TimeInterval, newPosition: TimeInterval) -> Bool
- (BOOL)moveRecordingPartFrom:(NSTimeInterval * _Nonnull)from to:(NSTimeInterval * _Nonnull)to newPosition:(NSTimeInterval * _Nonnull)newPosition
Arguments
from

TimeIntervalNSTimeInterval *required

Start time of the recording part that you want to move
to

TimeIntervalNSTimeInterval *required

End time of the recording part that you want to move
newPosition

TimeIntervalNSTimeInterval *required

New start time of the recording part
Return
BoolBOOL - Result of operation
func confirmRecording()- (void)confirmRecording
Confirms recording, publishes it. After confirmRecording is called, video becomes available to other users. Should be called after completeRecording is called and before new recording had been started.
Copy
public func confirmRecording()
- (void)confirmRecording
func cancelRecording()- (void)cancelRecording
Cancels recording and deletes it.
Copy
public func cancelRecording()
- (void)cancelRecording

VKLiveStreamViewController
Expand all / Collapse all

Live stream view controller provides a facility to perform live streaming, when streaming is finished video will be stored on video.io as regular video.

Properties

delegateVKLiveStreamViewProtocol
The delegate to be called by the live streamer.
tags[String]NSArray<NSString *>
Tags of newly created live stream.
metadata[String : String]NSDictionary<NSString *, NSString *>
Metadata of newly created live stream.
streamTitleStringNSString
Live stream title
showControlsBoolBOOL
Indicates whether standart UI will be shown or not. Default is true.
captureTypeVKCaptureType
Indicates the capture device that it will stream from. KVO Observable.
streamStateVKLiveStreamState
The current state of the of the live stream. KVO Observable.
currentVideoObjectVKVideoObject?VKVideoObject * _Nullable
The video object of the live stream.

Methods

func startStreaming()- (void)startStreaming
Start live streaming or continues if paused.
Copy
public func startStreaming()
- (void)startStreaming
func pauseStreaming()- (void)pauseStreaming
Pause the current live streaming. Can only be called after streamState becomes is `streaming`.
Copy
public func pauseStreaming()
- (void)pauseStreaming
func completeStreaming()- (void)completeStreaming
Complete the live streaming. Can only be called after streamState becomes is `streaming`.
Copy
public func completeStreaming()
- (void)completeStreaming

Protocols

VKPlayerViewProtocol
Expand all / Collapse all

A set of delegate to be called from VKPlayerViewController

Methods

func vkPlayerViewControllerDidFinish(VKPlayerViewController)- (void)vkPlayerViewControllerDidFinish
Called when the player has finished playing the video.
Copy
optional func vkPlayerViewControllerDidFinish(_ player: VKPlayerViewController)
- (void)vkPlayerViewControllerDidFinish:(VKPlayerViewController * _Nonnull)player
Arguments
player

VKPlayerViewController *required

The player which called this method.
func vkPlayerViewControllerBuffering(VKPlayerViewController, buffering: Bool)- (void)vkPlayerViewControllerBuffering
Called when the player is buffering.
Copy
optional func vkPlayerViewControllerBuffering(_ player: VKPlayerViewController, buffering: Bool)
- (void)vkPlayerViewControllerBuffering:(VKPlayerViewController * _Nonnull)player buffering:(BOOL)buffering
Arguments
player

VKPlayerViewController *required

The player which called this method.
buffering

BoolBOOL *required

If the value is true then the player is buffering. However, when the player finishes buffering the delegate is called again with the value being false.
func vkPlayerViewControllerReadyToPlay(VKPlayerViewController)- (void)vkPlayerViewControllerReadyToPlay
Called when video is ready to play.
Copy
optional func vkPlayerViewControllerReadyToPlay(_ player: VKPlayerViewController)
- (void)vkPlayerViewControllerReadyToPlay:(VKPlayerViewController * _Nonnull)player
Arguments
player

VKPlayerViewController *required

The player which called this method.
func vkPlayerViewControllerFailedToPlay(VKPlayerViewController, error: Error)- (void)vkPlayerViewControllerFailedToPlay
Called when player tried to play an item but fails.
Copy
optional func vkPlayerViewControllerFailedToPlay(_ player: VKPlayerViewController, error: Error)
- (void)vkPlayerViewControllerFailedToPlay:(VKPlayerViewController * _Nonnull)player error:(NSError *)error
Arguments
player

VKPlayerViewController *required

The player which called this method.
error

Error *required

Error that caused the fail.

VKRecorderViewProtocol
Expand all / Collapse all

Delegate protocol for VKRecorderViewController to call.

Methods

func vkRecorderViewFinishedRecording(VKRecorderViewController, video: VKVideoObject)- (void)vkRecorderViewFinishedRecording
Called when the recorder is finished recording.
Copy
optional func vkRecorderViewFinishedRecording(_ recorder: VKRecorderViewController, video: VKVideoObject))
- (void)vkRecorderViewFinishedRecording:(VKRecorderViewController * _Nonnull)recorder video:(VKVideoObject *)video
Arguments
recorder

VKRecorderViewController *required

The recorder which called this method.
video

VKVideoObject *required

The video object of finished recording.
func vkRecorderViewCanceled(VKRecorderViewController)- (void)vkRecorderViewCanceled
Called when recorder view canceled the recording.
Copy
optional func vkRecorderViewCanceled(_ recorder: VKRecorderViewController)
- (void)vkRecorderViewCanceled:(VKRecorderViewController * _Nonnull)recorder
Arguments
recorder

VKRecorderViewController *required

The recorder which called this method.
func vkRecorderViewError(VKRecorderViewController, withError: Error)- (void)vkRecorderViewError
Called when recorder encounters an error.
Copy
optional func vkRecorderViewError(_ recorder: VKRecorderViewController, withError error: Error)
- (void)vkRecorderViewError:(VKRecorderViewController * _Nonnull)recorder withError:(NSError * _Nonnull)error
Arguments
recorder

VKRecorderViewController *required

The recorder which called this method.
error

ErrorNSError *required

The error produced from the recorder.

VKLiveStreamViewProtocol
Expand all / Collapse all

Delegate protocol for VKLiveStreamViewController to call.

Methods

func vkLiveStreamViewFinishedStreaming(VKLiveStreamViewController, video: VKVideoObject)- (void)vkLiveStreamViewFinishedStreaming
Called when the live stream is finished.
Copy
optional func vkLiveStreamViewFinishedStreaming(_ liveStreamer: VKLiveStreamViewController, video: VKVideoObject))
- (void)vkLiveStreamViewFinishedStreaming:(VKRecorderViewController * _Nonnull)liveStreamer video:(VKVideoObject *)video
Arguments
recorder

VKLiveStreamViewController *required

The live stream controller which called this method.
video

VKVideoObject *required

The video object of finished live streaming.
func vkLiveStreamViewError(VKLiveStreamViewController, withError: Error)- (void)vkLiveStreamViewError
Called when live stream encounters an error.
Copy
optional func vkLiveStreamViewError(_ liveStreamer: VKLiveStreamViewController, withError error: Error)
- (void)vkLiveStreamViewError:(VKLiveStreamViewController * _Nonnull)recorder withError:(NSError * _Nonnull)error
Arguments
recorder

VKLiveStreamViewController *required

The live stream controller which called this method.
error

ErrorNSError *required

The error produced from the live sream controller.

Enums

VKAccountState
Expand all / Collapse all

Current account state.

Values

connectedVKAccountStateConnected
The session has started.
connectingVKAccountStateConnecting
Connecting to server
disconnectedVKAccountStateDisconnected
Session has stopped
errorVKAccountStateError
There was an error trying to connect to server. You should check VKAccount.error to see the description of the error

VKPlayState
Expand all / Collapse all

Indicates the differnt play state.

Values

unknownVKPlayStateUnknown
This is an unknown undefined state.
pauseVKPlayStatePause
Pause state.
playingVKPlayStatePlaying
Playing state.

VKAspectMode
Expand all / Collapse all

Indicates the different aspect mode.

Values

resizeAspectVKAspectModeResizeAspect
The aspect ratio is respected and the entire frame could be seen.
resizeAspectFillVKAspectModeResizeAspectFill
The aspect ratio is respected but the frame would fill the entire view.
resizeVKAspectModeResize
The aspect ratio is not respected but the entire frame would fill the view.

VKCaptureType
Expand all / Collapse all

Indicates the cature device.

Values

frontVKCaptureTypeFront
The front camera.
backVKCaptureTypeBack
The back camera.
audioOnlyVKCaptureTypeAudioOnly
Audio only.

VKRecordState
Expand all / Collapse all

Indicate the current state of the recorder.

Values

readyVKRecordStateReady
Ready to record.
recordingVKRecordStateRecording
Recording video.
previewingVKRecordStatePreviewing
Preview mode of what was recorded.

VKRecordCaptureRatio
Expand all / Collapse all

The frame capture ratio.

Values

squareVKRecordCaptureRatioSquare
Square ratio.
widescreenVKRecordCaptureRatioWidescreen
Wide 16:9 format.

VKLiveStreamState
Expand all / Collapse all

Indicate the current state of the live stream.

Values

idleVKLiveStreamStateIdle
Idle state.
connectingVKLiveStreamStateConnecting
Live steam is connecting to servers.
streamingVKLiveStreamStateStreaming
Live steam is active.
pausedVKLiveStreamStatePaused
Live steam is paused.
failedVKLiveStreamStateFailed
Live steam is failed.

Constants

VKNotificationConstants
Expand all / Collapse all

Notifications that comes from VKit

Values

VKNotificationConstants.AccountStateChanged
Sent when the account state of VKAccount has been changed.
VKNotificationConstants.VideoIsRecordered
Sent when the video recording has been completed. Notification contains localFile with path to local video file in userInfo dictionary. This path can be used for previewing video in case of custom implemenation of recorder UI.
VKNotificationConstants.VideoIsConfirmed
Sent when the video has been confirmed in VKRecorderViewController and video uploading began. Notification contains videoId of confirmed video in userInfo dictionary.
VKNotificationConstants.VideoIsUploaded
Sent when uploading of video has been completed. Notification contains videoId of uploaded video in userInfo dictionary.
VKNotificationConstants.VideoUploadsUpdated
Sent when uploads property of VKVideoUploadsManager has been updated.
VKNotificationConstants.VideoRecordingFailed
Sent when the video recoding failed. Notification contains error with Error describing the problem in userInfo dictionary.
VKNotificationConstants.VideoPlaybackFailed
Sent when the video playback failed. Notification contains videoId of failed to play video and error with Error describing the problem in userInfo dictionary.