mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
[ASVideoNode, ASVideoPlayerNode] Add video composition and audio mix capabilities (#1800)
* [ASVideoNode] Add delegate method called when the currentItem is set. * [ASVideoNode] Add videoComposition and audioMix properties to the ASVideoNode. * [ASVideoPlayerNode] Add new initialiser with videoComposition and audioMix, and forward new delegate method. * [ASVideoPlayerNode] Forward missing ASVideoNodeDelegate methods.
This commit is contained in:
@@ -58,8 +58,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (instancetype)initWithUrl:(NSURL*)url;
|
||||
- (instancetype)initWithAsset:(AVAsset*)asset;
|
||||
- (instancetype)initWithAsset:(AVAsset *)asset videoComposition:(AVVideoComposition *)videoComposition audioMix:(AVAudioMix *)audioMix;
|
||||
- (instancetype)initWithUrl:(NSURL *)url loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible;
|
||||
- (instancetype)initWithAsset:(AVAsset *)asset loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible;
|
||||
- (instancetype)initWithAsset:(AVAsset *)asset videoComposition:(AVVideoComposition *)videoComposition audioMix:(AVAudioMix *)audioMix loadAssetWhenNodeBecomesVisible:(BOOL)loadAssetWhenNodeBecomesVisible;
|
||||
|
||||
#pragma mark - Public API
|
||||
- (void)seekToTime:(CGFloat)percentComplete;
|
||||
@@ -156,10 +158,43 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode has played to its end time.
|
||||
* @param videoPlayerNode The video node has played to its end time.
|
||||
* @param videoPlayer The video node has played to its end time.
|
||||
*/
|
||||
- (void)videoPlayerNodeDidPlayToEnd:(ASVideoPlayerNode *)videoPlayer;
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode has constructed its AVPlayerItem for the asset.
|
||||
* @param videoPlayer The video player node.
|
||||
* @param currentItem The AVPlayerItem that was constructed from the asset.
|
||||
*/
|
||||
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didSetCurrentItem:(AVPlayerItem *)currentItem;
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode stalls.
|
||||
* @param videoPlayer The video player node that has experienced the stall
|
||||
* @param second Current playback time when the stall happens
|
||||
*/
|
||||
- (void)videoPlayerNode:(ASVideoPlayerNode *)videoPlayer didStallAtTimeInterval:(NSTimeInterval)timeInterval;
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode starts the inital asset loading
|
||||
* @param videoPlayer The videoPlayer
|
||||
*/
|
||||
- (void)videoPlayerNodeDidStartInitialLoading:(ASVideoPlayerNode *)videoPlayer;
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode is done loading the asset and can start the playback
|
||||
* @param videoPlayer The videoPlayer
|
||||
*/
|
||||
- (void)videoPlayerNodeDidFinishInitialLoading:(ASVideoPlayerNode *)videoPlayer;
|
||||
|
||||
/**
|
||||
* @abstract Delegate method invoked when the ASVideoNode has recovered from the stall
|
||||
* @param videoPlayer The videoplayer
|
||||
*/
|
||||
- (void)videoPlayerNodeDidRecoverFromStall:(ASVideoPlayerNode *)videoPlayer;
|
||||
|
||||
|
||||
@end
|
||||
NS_ASSUME_NONNULL_END
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user