YoutubeMedia
@interface YoutubeMedia : VoucherMedia
YoutubeMedia is a VoucherMedia 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
Usercan add to a YouTube video.Declaration
Objective-C
@property (assign, readwrite, nonatomic) NSString *userVideoDescription;Swift
var userVideoDescription: String! { get set } -
-initWithVideoId:thumbnail:title:description:userVideoDescription:channelName:publishDate:startTime:endTime:Default initializer for
YoutubeMedia.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
Useradded 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
YoutubeMedia. -
Alternative initializer that takes a dictionary form of a
YoutubeMediaand converts it to aYoutubeMedia.Declaration
Objective-C
- (instancetype)initWithNSDictionary:(NSDictionary *)dictionary;Swift
init!(nsDictionary dictionary: [AnyHashable : Any]!)Parameters
dictionary- dictionary form of
YoutubeMedia.Return Value
Instance of
YoutubeMedia. -
+youtubeMediaWithVideoId:thumbnail:title:description:userVideoDescription:channelName:publishDate:startTime:endTime:Static initializer for
YoutubeMedia.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;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
Useradded 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
YoutubeMedia. -
Changes the start and end time for a
YoutubeMedia.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.
View on GitHub
YoutubeMedia Class Reference