Giter Club home page Giter Club logo

ios-kryoutube's Introduction

Supports

KRYoutube supports ARC.

KRYoutube can upload a video to youtube, and you can update information of video or delete it.

KRYoutube use ASIHttpRequest framework to connect the HTTP protocol, but the ASIHttpRequest already stop their maintain that don't worry about it can't use fluently.

If you use ARC that you need to remember to setup ASIHttpRequest to be " -fno-objc-arc " in the 「TARGETS > Build Phases」setting page.

How To Get Started

#import "KRYoutube.h"
//Please Remember to implement <KRYoutubeDelegate>

- (void)viewDidLoad
{
    [super viewDidLoad];
    /*
     * You need to go to KRYoutubeService.h to setup the krYoutubeDeveloperKey and your Acoount infomation first.
     */
    krYoutube = [[KRYoutube alloc] initWithDelegate:self];
}

-(void)uploadVideoProgress
{
    CGFloat _uploadingProgress = [self.krYoutube getProgressFloatNumber];
    NSLog(@"Uploading Progress : %f", _uploadingProgress);
}

-(void)uploadVideo
{
    self.krYoutube.useSync = NO;
    NSString *_localFilePath = @"/usr/local/sample.avi";
    [self.krYoutube directUploadPath:_localFilePath
                               title:@"test and funny video."
                         description:@"welcome to watch this one."
                            category:krYoutubeCategoryOfPeople
                            keywords:@"sample, test, others"
                            progress:nil];
    
}

-(void)updateVideo
{
    [self.krYoutube directUpadteId:self._youtubeVideoId
                             title:@"update title"
                       description:@"update description"
                          category:krYoutubeCategoryOfEducation
                          keywords:@"happy open soure"
                          progress:nil];
}

-(void)deleteVideo
{
    [self.krYoutube deleteVideoWithId:self._youtubeVideoId progress:nil];
}

#pragma KRYoutubeDelegate
/*
 * @ Findish Upload Video.
 */
-(void)krYoutubeDidUploadFinishedVideoId:(NSString *)_videoId videoInfo:(NSMutableDictionary *)_videoInfo
{
    //To record the _videoId ( Youtube video unique ID ) then you can use it to update or delete video.
    self._youtubeVideoId = _videoId;
    NSLog(@"uploaded video info : %@", _videoInfo);
}

/*
 * @ Finish Update Video Info.
 */
-(void)krYoutubeDidUpdateFinishedVideoId:(NSString *)_videoId videoInfo:(NSMutableDictionary *)_videoInfo
{
    
}

/*
 * @ Finish Delete Video.
 */
-(void)krYoutubeDidDeleteFinishedVideoId:(NSString *)_videoId videoInfo:(NSMutableDictionary *)_videoInfo
{
    
}

Version

V1.0

LICENSE

MIT.

ios-kryoutube's People

Contributors

kalvar avatar

Watchers

Dinh Viet Phu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.