VKVideos

@objc
public class VKVideos : NSObject

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

Public methods

  • Declaration

    Swift

    public static let shared: VKVideos
  • Makes a request for a set of videos to be returned

    Declaration

    Swift

    public func getPlaylist(withTags tags: Set<String>, withMetadata metadata: [String : String], withOrder order: Bool = true, completion: @escaping VKPlaylistRequestBlock)

    Parameters

    tags

    This is a set of string tags to search for. Must not be nil but could be empty

    metadata

    This is a dictionary of metadatas to search for. Must not be nil but could be empty

    order

    This is a bool value indicates the order of sorting videos in playlist. Default - true.

    completion

    This is the 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

  • Makes a request for concrete video to be returned.

    Declaration

    Swift

    @discardableResult
    public func get(byFilter filter: VKVideoFilter, sortOrder: VKSortOrder, completion: @escaping VKVideosRequestBlock) -> VKCancellable

    Parameters

    videoID

    video identifier to be retrieved.

    completion

    This is the completion block to be called when the video is returned. If the call was successful then a VVideoObject is returned. Else nil is returned with an error included

  • Makes a request for concrete video to be returned.

    Declaration

    Swift

    @discardableResult
    public func get(byVideoId id: String, completion: @escaping VKVideoRequestBlock) -> VKCancellable

    Parameters

    videoID

    video identifier to be retrieved.

    completion

    This is the completion block to be called when the video is returned. If the call was successful then a VVideoObject is returned. Else nil is returned with an error included

  • Makes a request for multiple videos to be returned.

    Declaration

    Swift

    @discardableResult
    public func get(byVideoIds ids: [String], completion: @escaping VKVideosRequestBlock) -> VKCancellable

    Parameters

    videoIDs

    video ids to be retrieved.

    completion

    This is the completion block to be called when the video is returned. If the call was successful then a VVideoObject is returned. Else nil is returned with an error included

  • Video to remove from the store

    Declaration

    Swift

    @discardableResult
    public func delete(_ video: VKVideo, completion: @escaping (Error?) -> Void) -> VKCancellable

    Parameters

    video

    the video object that you wish to remove

  • Video to remove from the store

    Declaration

    Swift

    @discardableResult
    public func delete(videoId id: String, completion: @escaping (Error?) -> Void) -> VKCancellable

    Parameters

    id

    the video id that you wish to remove

  • Updates a videos title, tags and metadata

    Declaration

    Swift

    @discardableResult
    public func update(videoId id: String, title: String?, tags: Set<String>?, metadata: [String : String]?, completion: @escaping VKRequestCompletionBlock) -> VKCancellable

    Parameters

    id

    the video id that you wish to remove