DaiYoutubeParserSwift
Parse the youtube video url path, do any custom things you want.
DaidoujiChen
Installation
Copy all the files in DaiYoutubeParserSwift\DaiYoutubeParser
to your project.
And add
#import "DaiYoutubeParserRuntime.h"
to your Objective-C Bridging Header
Usage
It is very easy to use, there is a only method
parse(youtubeID: String, screenSize: CGSize, videoQuality: DaiYoutubeParserQuality, completion: DaiYoutubeParserComplection)
- youtubeID, your target youtube video ID
- screenSize, the screen size you want to show
- videoQuality, choose the video quality. If the screenSize is not large enough, the video qulity can not get the better one
- completion, callback success or fail, and the video url path
simple to use
DaiYoutubeParser.parse("2cEi8IpUpBo", screenSize: CGSizeZero, videoQuality: .Small) { (status, url, videoTitle, videoDuration) -> Void in
if status == .Success {
print(videoTitle);
print(videoDuration);
print(url);
}
else {
print("load fail")
}
}