hank
2019-01-22 bf63695cd124ba0c3127f4cc8aa99c737729dd1d
commit | author | age
bad748 1 // Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
W 2 //
3 // You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
4 // copy, modify, and distribute this software in source code or binary form for use
5 // in connection with the web services and APIs provided by Facebook.
6 //
7 // As with any software that integrates with the Facebook platform, your use of
8 // this software is subject to the Facebook Developer Principles and Policies
9 // [http://developers.facebook.com/policy/]. This copyright notice shall be
10 // included in all copies or substantial portions of the software.
11 //
12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
14 // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
15 // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
16 // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
17 // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18
13e53a 19 #import <Photos/Photos.h>
bad748 20 #import <UIKit/UIKit.h>
W 21
22 #import <FBSDKCoreKit/FBSDKCopying.h>
13e53a 23 #import <FBSDKShareKit/FBSDKSharingValidation.h>
bad748 24
W 25 @class FBSDKSharePhoto;
13e53a 26 @class PHAsset;
bad748 27
9febd9 28 /**
W 29   A video for sharing.
bad748 30  */
13e53a 31 @interface FBSDKShareVideo : NSObject <FBSDKCopying, FBSDKSharingValidation, NSSecureCoding>
H 32
33 /**
34  Convenience method to build a new video object from raw data.
35  - Parameter data: The NSData object that holds the raw video data.
36  */
37 + (instancetype)videoWithData:(NSData *)data;
38
39 /**
40  Convenience method to build a new video object with NSData and a previewPhoto.
41  - Parameter data: The NSData object that holds the raw video data.
42  - Parameter previewPhoto: The photo that represents the video.
43  */
44 + (instancetype)videoWithData:(NSData *)data previewPhoto:(FBSDKSharePhoto *)previewPhoto;
45
46 /**
47  Convenience method to build a new video object with a PHAsset.
48  @param videoAsset The PHAsset that represents the video in the Photos library.
49  */
50 + (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset;
51
52 /**
53  Convenience method to build a new video object with a PHAsset and a previewPhoto.
54  @param videoAsset The PHAsset that represents the video in the Photos library.
55  @param previewPhoto The photo that represents the video.
56  */
57 + (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset previewPhoto:(FBSDKSharePhoto *)previewPhoto;
bad748 58
9febd9 59 /**
W 60   Convenience method to build a new video object with a videoURL.
13e53a 61  @param videoURL The URL to the video.
bad748 62  */
W 63 + (instancetype)videoWithVideoURL:(NSURL *)videoURL;
64
9febd9 65 /**
13e53a 66   Convenience method to build a new video object with a videoURL and a previewPhoto.
H 67  @param videoURL The URL to the video.
68  @param previewPhoto The photo that represents the video.
bad748 69  */
W 70 + (instancetype)videoWithVideoURL:(NSURL *)videoURL previewPhoto:(FBSDKSharePhoto *)previewPhoto;
71
9febd9 72 /**
13e53a 73  The raw video data.
H 74  - Returns: The video data.
75  */
76 @property (nonatomic, strong) NSData *data;
77
78 /**
79  The representation of the video in the Photos library.
80  @return PHAsset that represents the video in the Photos library.
81  */
82 @property (nonatomic, copy) PHAsset *videoAsset;
83
84 /**
9febd9 85   The file URL to the video.
13e53a 86  @return URL that points to the location of the video on disk
bad748 87  */
W 88 @property (nonatomic, copy) NSURL *videoURL;
89
9febd9 90 /**
W 91   The photo that represents the video.
13e53a 92  @return The photo
bad748 93  */
W 94 @property (nonatomic, copy) FBSDKSharePhoto *previewPhoto;
95
9febd9 96 /**
W 97   Compares the receiver to another video.
13e53a 98  @param video The other video
H 99  @return YES if the receiver's values are equal to the other video's values; otherwise NO
bad748 100  */
W 101 - (BOOL)isEqualToShareVideo:(FBSDKShareVideo *)video;
102
103 @end
13e53a 104
H 105 @interface PHAsset (FBSDKShareVideo)
106
107 @property (nonatomic, copy, readonly) NSURL *videoURL;
108
109 @end