2010-09-13 43 views

回答

3

這是一個兩個步驟:採集視頻,然後上傳視頻

1 /拍攝視頻時,可以使用的UIImagePickerController

This is a good tutorial從圖書館或相機

2選擇照片/視頻/上傳視頻,你需要取出數據,然後上傳它

捕獲視頻後,您將返回一個NSURL *網址。

- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)mediaDict { 


    NSString *type = [mediaDict objectForKey:UIImagePickerControllerMediaType]; 

    if ([type isEqualToString:(NSString *)kUTTypeVideo] || 
     [type isEqualToString:(NSString *)kUTTypeMovie]) { // movie != video 
     NSURL *url = [mediaDict objectForKey:UIImagePickerControllerMediaURL]; 
     NSData *data = [NSData dataWithContentsOfURL:videoURL]; 
     // UPLOAD THIS DATA 
    } 
    return nil; 
    } 
相關問題