VOYouTubeMedia

@interface VOYouTubeMedia : VOVoucherMedia

VOYouTubeMedia is a VOVoucherMedia that represents a YouTube Video.

  • The video id provided by YouTube.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *videoId;

    Swift

    var videoId: String! { get }
  • The video title provided by YouTube.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *videoTitle;

    Swift

    var videoTitle: String! { get }
  • The video description provided by YouTube.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *videoDescription;

    Swift

    var videoDescription: String! { get }
  • The name of the YouTube channel the video is owned by.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSString *channelName;

    Swift

    var channelName: String! { get }
  • The date the YouTube video was published.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSDate *publishDate;

    Swift

    var publishDate: Date! { get }
  • The time in seconds when the video should start playing at.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger startTime;

    Swift

    var startTime: Int { get }
  • The time in seconds when the video should stop playing at.

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger endTime;

    Swift

    var endTime: Int { get }
  • A description of the video a VOUser can add to a YouTube video.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) NSString *userVideoDescription;

    Swift

    var userVideoDescription: String! { get set }
  • Default initializer for VOYouTubeMedia.

    Declaration

    Objective-C

    - (instancetype)initWithVideoId:(NSString *)videoId
                          thumbnail:(NSString *)thumbnail
                              title:(NSString *)title
                        description:(NSString *)description
               userVideoDescription:(NSString *)userVideoDescription
                        channelName:(NSString *)channelName
                        publishDate:(NSDate *)publishDate
                          startTime:(NSInteger)startTime
                            endTime:(NSInteger)endTime;

    Swift

    init!(videoId: String!, thumbnail: String!, title: String!, description: String!, userVideoDescription: String!, channelName: String!, publishDate: Date!, startTime: Int, endTime: Int)

    Parameters

    videoId

    - the video id of the YouTube video.

    thumbnail

    - The thumbnail image of the YouTube video.

    title

    - The title of the YouTube video.

    description

    - The description of the YouTube video.

    userVideoDescription

    - A description of the video a VOUser added to the video.

    channelName

    - The name of the YouTube channel the video is owned by.

    publishDate

    - The date the YouTube video was published.

    startTime

    - The time in seconds when the video should start playing at.

    endTime

    - The time in seconds when the video should stop playing at.

    Return Value

    Instance of VOYouTubeMedia.

  • Alternative initializer that takes a dictionary form of a VOYouTubeMedia and converts it to a VOYouTubeMedia.

    Declaration

    Objective-C

    - (instancetype)initWithNSDictionary:(NSDictionary *)dictionary;

    Swift

    init!(nsDictionary dictionary: [AnyHashable : Any]!)

    Parameters

    dictionary

    - dictionary form of VOYouTubeMedia.

    Return Value

    Instance of VOYouTubeMedia.

  • Static initializer for VOYouTubeMedia.

    Declaration

    Objective-C

    + (instancetype)youtubeMediaWithVideoId:(NSString *)videoId
                                  thumbnail:(NSString *)thumbnail
                                      title:(NSString *)title
                                description:(NSString *)description
                       userVideoDescription:(NSString *)userVideoDescription
                                channelName:(NSString *)channelName
                                publishDate:(NSDate *)publishDate
                                  startTime:(NSInteger)startTime
                                    endTime:(NSInteger)endTime;

    Swift

    class func youtubeMedia(withVideoId videoId: String!, thumbnail: String!, title: String!, description: String!, userVideoDescription: String!, channelName: String!, publishDate: Date!, startTime: Int, endTime: Int) -> Self!

    Parameters

    videoId

    - the video id of the YouTube video.

    thumbnail

    - The thumbnail image of the YouTube video.

    title

    - The title of the YouTube video.

    description

    - The description of the YouTube video.

    userVideoDescription

    - A description of the video a VOUser added to the video.

    channelName

    - The name of the YouTube channel the video is owned by.

    publishDate

    - The date the YouTube video was published.

    startTime

    - The time in seconds when the video should start playing at.

    endTime

    - The time in seconds when the video should stop playing at.

    Return Value

    Instance of VOYouTubeMedia.

  • Changes the start and end time for a VOYouTubeMedia.

    Declaration

    Objective-C

    - (void)setStartTime:(NSInteger)startTime andEndTime:(NSInteger)endTime;

    Swift

    func setStartTime(_ startTime: Int, andEndTime endTime: Int)

    Parameters

    startTime

    - The new start time for the video.

    endTime

    - The new end time for the video.

  • Helper to convert a date string from YouTube to an NSDate.

    Declaration

    Objective-C

    + (NSDate *)dateFromYoutubeDateString:(NSString *)dateString;

    Swift

    class func date(fromYoutubeDateString dateString: String!) -> Date!

    Parameters

    dateString

    - the date string formatted by YouTube.

    Return Value

    NSDate of the dateString.