IPhoneDeveloped inSimulatorAddVideoYes, this article introduces the right content.VideoAddSimulatorThe iTunes synchronization method on the real machine is useless. CocoaChina member "castielyue" shared hisVideoAdd a project, place the video in the resource, change the video name in viewdidload, and add itSimulator. Download the attachment SaveVideo.zip (1068 K ).
The following functions are used here:
- UIVideoAtPathIsCompatibleWithSavedPhotosAlbum
-
- Returns a Boolean value indicating whether the specified video can be saved to user’s Saved Photos album.
-
- BOOL UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (
- NSString *videoPath
- );
Parameters
VideoPath
The filesystem path to the movie file you want to save.
Return Value
YES if the video can be saved to the photo album or NO if it cannot.
Discussion
Not all devices are able to play video files placed in the user's Saved Photos album. so, before attempting to save videos to the user's camera roll, you should call this function to ensure that saving the video is supported for the current device.
Corresponding, forwardSimulatorYou can use this function to add images.
- UIImageWriteToSavedPhotosAlbum
- Adds the specified image to the user’s Saved Photos album.
- void UIImageWriteToSavedPhotosAlbum (
- UIImage *image,
- id completionTarget,
- SEL completionSelector,
- void *contextInfo
- );
Parameters
Image
The image to write to the user's device.
CompletionTarget
The object whose selector shocould be called after the image has been written to the user's device.
CompletionSelector
The method selector, of the target object, to call. This optional method shocould be of the form:
- - (void) image: (UIImage *) image
- didFinishSavingWithError: (NSError *) error
- contextInfo: (void *) contextInfo;
ContextInfo
An optional pointer to any context-specific data that you want passed to the completion selector.
Discussion
The use of the completionTarget, completionSelector, and contextInfo parameters is optional and necessary only if you want to be notified asynchronously when the function finishes writing the image to the user's Saved Photos album. if you do not want to be notified, pass nil for these parameters.
Summary:IPhoneDeveloped inSimulatorAddVideoI hope this article will help you!
From: http://www.cocoachina.com/iphonedev/sdk/2010/1229/2520.html