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