commit | author | age
|
2e29a3
|
1 |
/* |
L |
2 |
* Copyright (c) Meta Platforms, Inc. and affiliates. |
|
3 |
* All rights reserved. |
|
4 |
* |
|
5 |
* This source code is licensed under the license found in the |
|
6 |
* LICENSE file in the root directory of this source tree. |
|
7 |
*/ |
|
8 |
|
|
9 |
#import <Photos/Photos.h> |
|
10 |
#import <UIKit/UIKit.h> |
|
11 |
|
|
12 |
#import <FBSDKCoreKit/FBSDKCoreKit.h> |
|
13 |
#import <FBSDKShareKit/FBSDKShareMediaContent.h> |
|
14 |
#import <FBSDKShareKit/FBSDKSharingValidation.h> |
|
15 |
NS_ASSUME_NONNULL_BEGIN |
|
16 |
|
|
17 |
@class FBSDKSharePhoto; |
|
18 |
@class PHAsset; |
|
19 |
|
|
20 |
/** |
|
21 |
A video for sharing. |
|
22 |
*/ |
|
23 |
NS_SWIFT_NAME(ShareVideo) |
|
24 |
@interface FBSDKShareVideo : NSObject <NSSecureCoding, NSCopying, NSObject, FBSDKShareMedia, FBSDKSharingValidation> |
|
25 |
|
|
26 |
/** |
|
27 |
Convenience method to build a new video object from raw data. |
|
28 |
- Parameter data: The NSData object that holds the raw video data. |
|
29 |
*/ |
|
30 |
+ (instancetype)videoWithData:(NSData *)data; |
|
31 |
|
|
32 |
/** |
|
33 |
Convenience method to build a new video object with NSData and a previewPhoto. |
|
34 |
- Parameter data: The NSData object that holds the raw video data. |
|
35 |
- Parameter previewPhoto: The photo that represents the video. |
|
36 |
*/ |
|
37 |
+ (instancetype)videoWithData:(NSData *)data previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
|
38 |
|
|
39 |
/** |
|
40 |
Convenience method to build a new video object with a PHAsset. |
|
41 |
@param videoAsset The PHAsset that represents the video in the Photos library. |
|
42 |
*/ |
|
43 |
+ (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset; |
|
44 |
|
|
45 |
/** |
|
46 |
Convenience method to build a new video object with a PHAsset and a previewPhoto. |
|
47 |
@param videoAsset The PHAsset that represents the video in the Photos library. |
|
48 |
@param previewPhoto The photo that represents the video. |
|
49 |
*/ |
|
50 |
+ (instancetype)videoWithVideoAsset:(PHAsset *)videoAsset previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
|
51 |
|
|
52 |
/** |
|
53 |
Convenience method to build a new video object with a videoURL. |
|
54 |
@param videoURL The URL to the video. |
|
55 |
*/ |
|
56 |
+ (instancetype)videoWithVideoURL:(NSURL *)videoURL; |
|
57 |
|
|
58 |
/** |
|
59 |
Convenience method to build a new video object with a videoURL and a previewPhoto. |
|
60 |
@param videoURL The URL to the video. |
|
61 |
@param previewPhoto The photo that represents the video. |
|
62 |
*/ |
|
63 |
+ (instancetype)videoWithVideoURL:(NSURL *)videoURL previewPhoto:(FBSDKSharePhoto *)previewPhoto; |
|
64 |
|
|
65 |
/** |
|
66 |
The raw video data. |
|
67 |
- Returns: The video data. |
|
68 |
*/ |
|
69 |
@property (nullable, nonatomic, strong) NSData *data; |
|
70 |
|
|
71 |
/** |
|
72 |
The representation of the video in the Photos library. |
|
73 |
@return PHAsset that represents the video in the Photos library. |
|
74 |
*/ |
|
75 |
@property (nullable, nonatomic, copy) PHAsset *videoAsset; |
|
76 |
|
|
77 |
/** |
|
78 |
The file URL to the video. |
|
79 |
@return URL that points to the location of the video on disk |
|
80 |
*/ |
|
81 |
@property (nullable, nonatomic, copy) NSURL *videoURL; |
|
82 |
|
|
83 |
/** |
|
84 |
The photo that represents the video. |
|
85 |
@return The photo |
|
86 |
*/ |
|
87 |
@property (nullable, nonatomic, copy) FBSDKSharePhoto *previewPhoto; |
|
88 |
|
|
89 |
/** |
|
90 |
Compares the receiver to another video. |
|
91 |
@param video The other video |
|
92 |
@return YES if the receiver's values are equal to the other video's values; otherwise NO |
|
93 |
*/ |
|
94 |
- (BOOL)isEqualToShareVideo:(FBSDKShareVideo *)video; |
|
95 |
|
|
96 |
@end |
|
97 |
|
|
98 |
@interface PHAsset (FBSDKShareVideo) |
|
99 |
|
|
100 |
@property (nonatomic, readonly, copy) NSURL *videoURL; |
|
101 |
|
|
102 |
@end |
|
103 |
|
|
104 |
NS_ASSUME_NONNULL_END |