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> |
e81c27
|
23 |
#import <FBSDKShareKit/FBSDKShareMediaContent.h> |
13e53a
|
24 |
#import <FBSDKShareKit/FBSDKSharingValidation.h> |
e81c27
|
25 |
|
H |
26 |
NS_ASSUME_NONNULL_BEGIN |
bad748
|
27 |
|
W |
28 |
@class FBSDKSharePhoto; |
13e53a
|
29 |
@class PHAsset; |
bad748
|
30 |
|
9febd9
|
31 |
/** |
W |
32 |
A video for sharing. |
bad748
|
33 |
*/ |
e81c27
|
34 |
NS_SWIFT_NAME(ShareVideo) |
H |
35 |
@interface FBSDKShareVideo : NSObject <NSSecureCoding, FBSDKCopying, FBSDKShareMedia, FBSDKSharingValidation> |
13e53a
|
36 |
|
H |
37 |
/** |
|
38 |
Convenience method to build a new video object from raw data. |
|
39 |
- Parameter data: The NSData object that holds the raw video data. |
|
40 |
*/ |
|
41 |
+ (instancetype)videoWithData:(NSData *)data; |
|
42 |
|
|
43 |
/** |
|
44 |
Convenience method to build a new video object with NSData and a previewPhoto. |
|
45 |
- Parameter data: The NSData object that holds the raw video data. |
|
46 |
- Parameter previewPhoto: The photo that represents the video. |
|
47 |
*/ |
|
48 |
+ (instancetype)videoWithData:(NSData *)data previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
|
49 |
|
|
50 |
/** |
|
51 |
Convenience method to build a new video object with a PHAsset. |
|
52 |
@param videoAsset The PHAsset that represents the video in the Photos library. |
|
53 |
*/ |
|
54 |
+ (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset; |
|
55 |
|
|
56 |
/** |
|
57 |
Convenience method to build a new video object with a PHAsset and a previewPhoto. |
|
58 |
@param videoAsset The PHAsset that represents the video in the Photos library. |
|
59 |
@param previewPhoto The photo that represents the video. |
|
60 |
*/ |
|
61 |
+ (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
bad748
|
62 |
|
9febd9
|
63 |
/** |
W |
64 |
Convenience method to build a new video object with a videoURL. |
13e53a
|
65 |
@param videoURL The URL to the video. |
bad748
|
66 |
*/ |
W |
67 |
+ (instancetype)videoWithVideoURL:(NSURL *)videoURL; |
|
68 |
|
9febd9
|
69 |
/** |
13e53a
|
70 |
Convenience method to build a new video object with a videoURL and a previewPhoto. |
H |
71 |
@param videoURL The URL to the video. |
|
72 |
@param previewPhoto The photo that represents the video. |
bad748
|
73 |
*/ |
W |
74 |
+ (instancetype)videoWithVideoURL:(NSURL *)videoURL previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
|
75 |
|
9febd9
|
76 |
/** |
13e53a
|
77 |
The raw video data. |
H |
78 |
- Returns: The video data. |
|
79 |
*/ |
e81c27
|
80 |
@property (nonatomic, strong, nullable) NSData *data; |
13e53a
|
81 |
|
H |
82 |
/** |
|
83 |
The representation of the video in the Photos library. |
|
84 |
@return PHAsset that represents the video in the Photos library. |
|
85 |
*/ |
e81c27
|
86 |
@property (nonatomic, copy, nullable) PHAsset *videoAsset; |
13e53a
|
87 |
|
H |
88 |
/** |
9febd9
|
89 |
The file URL to the video. |
13e53a
|
90 |
@return URL that points to the location of the video on disk |
bad748
|
91 |
*/ |
e81c27
|
92 |
@property (nonatomic, copy, nullable) NSURL *videoURL; |
bad748
|
93 |
|
9febd9
|
94 |
/** |
W |
95 |
The photo that represents the video. |
13e53a
|
96 |
@return The photo |
bad748
|
97 |
*/ |
e81c27
|
98 |
@property (nonatomic, copy, nullable) FBSDKSharePhoto *previewPhoto; |
bad748
|
99 |
|
9febd9
|
100 |
/** |
W |
101 |
Compares the receiver to another video. |
13e53a
|
102 |
@param video The other video |
H |
103 |
@return YES if the receiver's values are equal to the other video's values; otherwise NO |
bad748
|
104 |
*/ |
W |
105 |
- (BOOL)isEqualToShareVideo:(FBSDKShareVideo *)video; |
|
106 |
|
|
107 |
@end |
13e53a
|
108 |
|
H |
109 |
@interface PHAsset (FBSDKShareVideo) |
|
110 |
|
|
111 |
@property (nonatomic, copy, readonly) NSURL *videoURL; |
|
112 |
|
|
113 |
@end |
e81c27
|
114 |
|
H |
115 |
NS_ASSUME_NONNULL_END |