CNZFPlayerController.h
24.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
//
// ZFPlayerController.h
// ZFPlayer
//
// Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "ZFPlayerMediaPlayback.h"
#import "ZFOrientationObserver.h"
#import "ZFPlayerMediaControl.h"
#import "ZFPlayerGestureControl.h"
#import "CNZFPlayerNotification.h"
#import "ZFFloatView.h"
#import "UIScrollView+ZFPlayer.h"
NS_ASSUME_NONNULL_BEGIN
@interface CNZFPlayerController : NSObject
/// The video contrainerView in normal model.
@property (nonatomic, strong) UIView *containerView;
/// The currentPlayerManager must conform `ZFPlayerMediaPlayback` protocol.
@property (nonatomic, strong) id<ZFPlayerMediaPlayback> currentPlayerManager;
/// The custom controlView must conform `ZFPlayerMediaControl` protocol.
@property (nonatomic, strong) UIView<ZFPlayerMediaControl> *controlView;
/// The notification manager class.
@property (nonatomic, strong, readonly) CNZFPlayerNotification *notification;
/// The container view type.
@property (nonatomic, assign, readonly) ZFPlayerContainerType containerType;
/// The player's small container view.
@property (nonatomic, strong, readonly) ZFFloatView *smallFloatView;
/// Whether the small window is displayed.
@property (nonatomic, assign, readonly) BOOL isSmallFloatViewShow;
/// Whether the player is fullScreened.
@property (nonatomic, assign) BOOL isFullScreen;
/// Whether the brightness and Volume Gestures of Player are available in half screen
@property (nonatomic, assign) BOOL brightnessVolumeGestureEnabled;
/*!
@method playerWithPlayerManager:containerView:
@abstract Create an ZFPlayerController that plays a single audiovisual item.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerView to see the video frames must set the contrainerView.
@result An instance of ZFPlayerController.
*/
+ (instancetype)playerWithPlayerManager:(id<ZFPlayerMediaPlayback>)playerManager containerView:(UIView *)containerView;
/*!
@method initWithPlayerManager:containerView:
@abstract Create an ZFPlayerController that plays a single audiovisual item.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerView to see the video frames must set the contrainerView.
@result An instance of ZFPlayerController.
*/
- (instancetype)initWithPlayerManager:(id<ZFPlayerMediaPlayback>)playerManager containerView:(UIView *)containerView;
/*!
@method playerWithScrollView:playerManager:containerViewTag:
@abstract Create an ZFPlayerController that plays a single audiovisual item. Use in `UITableView` or `UICollectionView`.
@param scrollView is `tableView` or `collectionView`.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerViewTag to see the video at scrollView must set the contrainerViewTag.
@result An instance of ZFPlayerController.
*/
+ (instancetype)playerWithScrollView:(UIScrollView *)scrollView playerManager:(id<ZFPlayerMediaPlayback>)playerManager containerViewTag:(NSInteger)containerViewTag;
/*!
@method initWithScrollView:playerManager:containerViewTag:
@abstract Create an ZFPlayerController that plays a single audiovisual item. Use in `UITableView` or `UICollectionView`.
@param scrollView is `tableView` or `collectionView`.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerViewTag to see the video at scrollView must set the contrainerViewTag.
@result An instance of ZFPlayerController.
*/
- (instancetype)initWithScrollView:(UIScrollView *)scrollView playerManager:(id<ZFPlayerMediaPlayback>)playerManager containerViewTag:(NSInteger)containerViewTag;
/*!
@method playerWithScrollView:playerManager:containerView:
@abstract Create an ZFPlayerController that plays a single audiovisual item. Use in `UIScrollView`.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerView to see the video at the scrollView.
@result An instance of ZFPlayerController.
*/
+ (instancetype)playerWithScrollView:(UIScrollView *)scrollView playerManager:(id<ZFPlayerMediaPlayback>)playerManager containerView:(UIView *)containerView;
/*!
@method initWithScrollView:playerManager:containerView:
@abstract Create an ZFPlayerController that plays a single audiovisual item. Use in `UIScrollView`.
@param playerManager must conform `ZFPlayerMediaPlayback` protocol.
@param containerView to see the video at the scrollView.
@result An instance of ZFPlayerController.
*/
- (instancetype)initWithScrollView:(UIScrollView *)scrollView playerManager:(id<ZFPlayerMediaPlayback>)playerManager containerView:(UIView *)containerView;
@end
@interface CNZFPlayerController (ZFPlayerTimeControl)
/// The player current play time.
@property (nonatomic, readonly) NSTimeInterval currentTime;
/// The player total time.
@property (nonatomic, readonly) NSTimeInterval totalTime;
/// The player buffer time.
@property (nonatomic, readonly) NSTimeInterval bufferTime;
/// The player progress, 0...1
@property (nonatomic, readonly) float progress;
/// The player bufferProgress, 0...1
@property (nonatomic, readonly) float bufferProgress;
/**
Use this method to seek to a specified time for the current player and to be notified when the seek operation is complete.
@param time seek time.
@param completionHandler completion handler.
*/
- (void)seekToTime:(NSTimeInterval)time completionHandler:(void (^ __nullable)(BOOL finished))completionHandler;
@end
@interface CNZFPlayerController (ZFPlayerPlaybackControl)
/// Resume playback record.default is NO.
/// Memory storage playback records.
@property (nonatomic, assign) BOOL resumePlayRecord;
/// 0...1.0
/// Only affects audio volume for the device instance and not for the player.
/// You can change device volume or player volume as needed,change the player volume you can conform the `ZFPlayerMediaPlayback` protocol.
@property (nonatomic) float volume;
/// The device muted.
/// Only affects audio muting for the device instance and not for the player.
/// You can change device mute or player mute as needed,change the player mute you can conform the `ZFPlayerMediaPlayback` protocol.
@property (nonatomic, getter=isMuted) BOOL muted;
// 0...1.0, where 1.0 is maximum brightness. Only supported by main screen.
@property (nonatomic) float brightness;
/// The play asset URL.
@property (nonatomic) NSURL *assetURL;
/// If tableView or collectionView has only one section , use `assetURLs`.
/// If tableView or collectionView has more sections , use `sectionAssetURLs`.
/// Set this you can use `playTheNext` `playThePrevious` `playTheIndex:` method.
@property (nonatomic, copy, nullable) NSArray <NSURL *>*assetURLs;
/// The currently playing index,limited to one-dimensional arrays.
@property (nonatomic) NSInteger currentPlayIndex;
/// is the last asset URL in `assetURLs`.
@property (nonatomic, readonly) BOOL isLastAssetURL;
/// is the first asset URL in `assetURLs`.
@property (nonatomic, readonly) BOOL isFirstAssetURL;
/// If Yes, player will be called pause method When Received `UIApplicationWillResignActiveNotification` notification.
/// default is YES.
@property (nonatomic) BOOL pauseWhenAppResignActive;
/// When the player is playing, it is paused by some event,not by user click to pause.
/// For example, when the player is playing, application goes into the background or pushed to another viewController
@property (nonatomic, getter=isPauseByEvent) BOOL pauseByEvent;
/// The current player controller is disappear, not dealloc
@property (nonatomic, getter=isViewControllerDisappear) BOOL viewControllerDisappear;
/// You can custom the AVAudioSession,
/// default is NO.
@property (nonatomic, assign) BOOL customAudioSession;
/// 0.5...2.0,
@property (nonatomic) float rate;
/// 是否循环播放
@property (nonatomic, assign) BOOL loop;
/// 播放器view填充方式
@property (nonatomic, assign) NSInteger videoGravity;
/// The block invoked when the player is Prepare to play.
@property (nonatomic, copy, nullable) void(^playerPrepareToPlay)(id<ZFPlayerMediaPlayback> asset, NSURL *assetURL);
/// The block invoked when the player is Ready to play.
@property (nonatomic, copy, nullable) void(^playerReadyToPlay)(id<ZFPlayerMediaPlayback> asset, NSURL *assetURL);
/// The block invoked when the player play progress changed.
@property (nonatomic, copy, nullable) void(^playerPlayTimeChanged)(id<ZFPlayerMediaPlayback> asset, NSTimeInterval currentTime, NSTimeInterval duration);
/// The block invoked when the player play buffer changed.
@property (nonatomic, copy, nullable) void(^playerBufferTimeChanged)(id<ZFPlayerMediaPlayback> asset, NSTimeInterval bufferTime);
/// The block invoked when the player playback state changed.
@property (nonatomic, copy, nullable) void(^playerPlayStateChanged)(id<ZFPlayerMediaPlayback> asset, ZFPlayerPlaybackState playState);
/// The block invoked when the player load state changed.
@property (nonatomic, copy, nullable) void(^playerLoadStateChanged)(id<ZFPlayerMediaPlayback> asset, ZFPlayerLoadState loadState);
/// The block invoked when the player play failed.
@property (nonatomic, copy, nullable) void(^playerPlayFailed)(id<ZFPlayerMediaPlayback> asset, id error);
/// The block invoked when the player play end.
@property (nonatomic, copy, nullable) void(^playerDidToEnd)(id<ZFPlayerMediaPlayback> asset);
// The block invoked when video size changed.
@property (nonatomic, copy, nullable) void(^presentationSizeChanged)(id<ZFPlayerMediaPlayback> asset, CGSize size);
// +++++++ The block invoked when the player screenmode changed
@property (nonatomic, copy, nullable) void(^playerScreenModeChanged)(BOOL isFullScreen, BOOL isFullScreenBtnClick);
/**
Play the next url ,while the `assetURLs` is not NULL.
*/
- (void)playTheNext;
/**
Play the previous url ,while the `assetURLs` is not NULL.
*/
- (void)playThePrevious;
/**
Play the index of url ,while the `assetURLs` is not NULL.
@param index play the index.
*/
- (void)playTheIndex:(NSInteger)index;
/**
Player stop and playerView remove from super view,remove other notification.
*/
- (void)stop;
/*!
@method replaceCurrentPlayerManager:
@abstract Replaces the player's current playeranager with the specified player item.
@param manager must conform `ZFPlayerMediaPlayback` protocol
@discussion The playerManager that will become the player's current playeranager.
*/
- (void)replaceCurrentPlayerManager:(id<ZFPlayerMediaPlayback>)manager;
/**
Add video to cell.
*/
- (void)addPlayerViewToCell;
/**
Add video to container view.
*/
- (void)addPlayerViewToContainerView:(UIView *)containerView;
/**
Add to small float view.
*/
- (void)addPlayerViewToSmallFloatView;
/**
Stop the current playing video and remove the playerView.
*/
- (void)stopCurrentPlayingView;
/**
stop the current playing video on cell.
*/
- (void)stopCurrentPlayingCell;
//@end
//
//@interface ZFPlayerController (ZFPlayerOrientationRotation)
//
//@property (nonatomic, readonly) ZFOrientationObserver *orientationObserver;
//
///// Whether automatic screen rotation is supported.
///// The value is NO.
///// This property is used for the return value of UIViewController `shouldAutorotate` method.
//@property (nonatomic, readonly) BOOL shouldAutorotate;
//
///// Whether allow the video orientation rotate.
///// default is YES.
//@property (nonatomic) BOOL allowOrentitaionRotation;
//
///// When ZFFullScreenMode is ZFFullScreenModeLandscape the orientation is LandscapeLeft or LandscapeRight, this value is YES.
///// When ZFFullScreenMode is ZFFullScreenModePortrait, while the player fullSceen this value is YES.
//@property (nonatomic, readonly) BOOL isFullScreen;
//
///// when call the `stop` method, exit the fullScreen model, default is YES.
//@property (nonatomic, assign) BOOL exitFullScreenWhenStop;
//
///// Lock the screen orientation.
//@property (nonatomic, getter=isLockedScreen) BOOL lockedScreen;
//
///// The current orientation of the player.
///// Default is UIInterfaceOrientationPortrait.
//@property (nonatomic, readonly) UIInterfaceOrientation currentOrientation;
//
///// The block invoked When player will rotate.
//@property (nonatomic, copy, nullable) void(^orientationWillChange)(ZFPlayerController *player, BOOL isFullScreen);
//
///// The block invoked when player rotated.
//@property (nonatomic, copy, nullable) void(^orientationDidChanged)(ZFPlayerController *player, BOOL isFullScreen);
//
///// default is UIStatusBarStyleLightContent.
//@property (nonatomic, assign) UIStatusBarStyle fullScreenStatusBarStyle;
//
///// defalut is UIStatusBarAnimationSlide.
//@property (nonatomic, assign) UIStatusBarAnimation fullScreenStatusBarAnimation;
//
///// The fullscreen statusbar hidden.
//@property (nonatomic, getter=isStatusBarHidden) BOOL statusBarHidden;
//
///**
// Add the device orientation observer.
// */
//- (void)addDeviceOrientationObserver;
//
///**
// Remove the device orientation observer.
// */
//- (void)removeDeviceOrientationObserver;
//
///**
// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
//
// @param orientation is UIInterfaceOrientation.
// @param animated is animated.
//*/
//- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated;
//
///**
// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
//
// @param orientation is UIInterfaceOrientation.
// @param animated is animated.
// @param completion rotating completed callback.
//*/
//- (void)rotateToOrientation:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
//
///**
// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
//
// @param fullScreen is fullscreen.
// @param animated is animated.
// @param completion rotating completed callback.
// */
//- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
//
///**
// Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModePortrait.
//
// @param fullScreen is fullscreen.
// @param animated is animated.
// */
//- (void)enterPortraitFullScreen:(BOOL)fullScreen animated:(BOOL)animated;
//
///**
// FullScreen mode is determined by ZFFullScreenMode.
//
// @param fullScreen is fullscreen.
// @param animated is animated.
// @param completion rotating completed callback.
// */
//- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated completion:(void(^ __nullable)(void))completion;
//
///**
// FullScreen mode is determined by ZFFullScreenMode.
//
// @param fullScreen is fullscreen.
// @param animated is animated.
// */
//- (void)enterFullScreen:(BOOL)fullScreen animated:(BOOL)animated;
/*
+++++++ enterFullScreen.
*/
- (void)enterFullScreen:(BOOL)fullScreen isFullScreenBtnClick:(BOOL)isClick;
@end
@interface CNZFPlayerController (ZFPlayerViewGesture)
/// An instance of ZFPlayerGestureControl.
@property (nonatomic, readonly) ZFPlayerGestureControl *gestureControl;
/// The gesture types that the player not support.
@property (nonatomic, assign) ZFPlayerDisableGestureTypes disableGestureTypes;
/// The pan gesture moving direction that the player not support.
@property (nonatomic) ZFPlayerDisablePanMovingDirection disablePanMovingDirection;
@end
@interface CNZFPlayerController (ZFPlayerScrollView)
/// The scroll view is `tableView` or `collectionView`.
@property (nonatomic, readonly, nullable) UIScrollView *scrollView;
/// The scrollView player should auto player, default is YES.
@property (nonatomic) BOOL shouldAutoPlay;
/// WWAN network auto play, only support in scrollView mode when the `shouldAutoPlay` is YES, default is NO.
@property (nonatomic, getter=isWWANAutoPlay) BOOL WWANAutoPlay;
/// The indexPath is playing.
@property (nonatomic, readonly, nullable) NSIndexPath *playingIndexPath;
/// The indexPath should be play while scrolling.
@property (nonatomic, readonly, nullable) NSIndexPath *shouldPlayIndexPath;
/// The view tag that the player display in scrollView.
@property (nonatomic, readonly) NSInteger containerViewTag;
/// The current playing cell stop playing when the cell has out off the screen,defalut is YES.
@property (nonatomic) BOOL stopWhileNotVisible;
/**
The current player scroll slides off the screen percent.
the property used when the `stopWhileNotVisible` is YES, stop the current playing player.
the property used when the `stopWhileNotVisible` is NO, the current playing player add to small container view.
The range is 0.0~1.0, defalut is 0.5.
0.0 is the player will disappear.
1.0 is the player did disappear.
*/
@property (nonatomic) CGFloat playerDisapperaPercent;
/**
The current player scroll to the screen percent to play the video.
The range is 0.0~1.0, defalut is 0.0.
0.0 is the player will appear.
1.0 is the player did appear.
*/
@property (nonatomic) CGFloat playerApperaPercent;
/// If tableView or collectionView has more sections, use `sectionAssetURLs`.
@property (nonatomic, copy, nullable) NSArray <NSArray <NSURL *>*>*sectionAssetURLs;
/// The block invoked When the player appearing.
@property (nonatomic, copy, nullable) void(^zf_playerAppearingInScrollView)(NSIndexPath *indexPath, CGFloat playerApperaPercent);
/// The block invoked When the player disappearing.
@property (nonatomic, copy, nullable) void(^zf_playerDisappearingInScrollView)(NSIndexPath *indexPath, CGFloat playerDisapperaPercent);
/// The block invoked When the player will appeared.
@property (nonatomic, copy, nullable) void(^zf_playerWillAppearInScrollView)(NSIndexPath *indexPath);
/// The block invoked When the player did appeared.
@property (nonatomic, copy, nullable) void(^zf_playerDidAppearInScrollView)(NSIndexPath *indexPath);
/// The block invoked When the player will disappear.
@property (nonatomic, copy, nullable) void(^zf_playerWillDisappearInScrollView)(NSIndexPath *indexPath);
/// The block invoked When the player did disappeared.
@property (nonatomic, copy, nullable) void(^zf_playerDidDisappearInScrollView)(NSIndexPath *indexPath);
/// The block invoked When the player should play.
@property (nonatomic, copy, nullable) void(^zf_playerShouldPlayInScrollView)(NSIndexPath *indexPath);
/// The block invoked When the player did stop scroll.
@property (nonatomic, copy, nullable) void(^zf_scrollViewDidEndScrollingCallback)(NSIndexPath *indexPath);
/// Filter the cell that should be played when the scroll is stopped (to play when the scroll is stopped).
- (void)zf_filterShouldPlayCellWhileScrolled:(void (^ __nullable)(NSIndexPath *indexPath))handler;
/// Filter the cell that should be played while scrolling (you can use this to filter the highlighted cell).
- (void)zf_filterShouldPlayCellWhileScrolling:(void (^ __nullable)(NSIndexPath *indexPath))handler;
/**
Play the indexPath of url without scroll postion, while the `assetURLs` or `sectionAssetURLs` is not NULL.
@param indexPath Play the indexPath of url.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath;
/**
Play the indexPath of url, while the `assetURLs` or `sectionAssetURLs` is not NULL.
@param indexPath Play the indexPath of url.
@param scrollPosition scroll position.
@param animated scroll animation.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath
scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
animated:(BOOL)animated;
/**
Play the indexPath of url with scroll postion, while the `assetURLs` or `sectionAssetURLs` is not NULL.
@param indexPath Play the indexPath of url.
@param scrollPosition scroll position.
@param animated scroll animation.
@param completionHandler Scroll completion callback.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath
scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
animated:(BOOL)animated
completionHandler:(void (^ __nullable)(void))completionHandler;
/**
Play the indexPath of url with scroll postion.
@param indexPath Play the indexPath of url
@param assetURL The player URL.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL;
/**
Play the indexPath of url with scroll postion.
@param indexPath Play the indexPath of url
@param assetURL The player URL.
@param scrollPosition scroll position.
@param animated scroll animation.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath
assetURL:(NSURL *)assetURL
scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
animated:(BOOL)animated;
/**
Play the indexPath of url with scroll postion.
@param indexPath Play the indexPath of url
@param assetURL The player URL.
@param scrollPosition scroll position.
@param animated scroll animation.
@param completionHandler Scroll completion callback.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath
assetURL:(NSURL *)assetURL
scrollPosition:(ZFPlayerScrollViewScrollPosition)scrollPosition
animated:(BOOL)animated
completionHandler:(void (^ __nullable)(void))completionHandler;
@end
@interface CNZFPlayerController (ZFPlayerDeprecated)
/**
Add the playerView to cell.
*/
- (void)updateScrollViewPlayerToCell __attribute__((deprecated("use `addPlayerViewToCell:` instead.")));
/**
Add the playerView to containerView.
@param containerView The playerView containerView.
*/
- (void)updateNoramlPlayerWithContainerView:(UIView *)containerView __attribute__((deprecated("use `addPlayerViewToContainerView:` instead.")));
/**
Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
@param indexPath Play the indexPath of url
@param scrollToTop Scroll the current cell to top with animations.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop __attribute__((deprecated("use `playTheIndexPath:scrollPosition:animated:` instead.")));
/**
Play the indexPath of url with scroll postion.
@param indexPath Play the indexPath of url
@param assetURL The player URL.
@param scrollToTop Scroll the current cell to top with animations.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath assetURL:(NSURL *)assetURL scrollToTop:(BOOL)scrollToTop __attribute__((deprecated("use `playTheIndexPath:assetURL:scrollPosition:animated:` instead.")));
/**
Play the indexPath of url ,while the `assetURLs` or `sectionAssetURLs` is not NULL.
@param indexPath Play the indexPath of url
@param scrollToTop scroll the current cell to top with animations.
@param completionHandler Scroll completion callback.
*/
- (void)playTheIndexPath:(NSIndexPath *)indexPath scrollToTop:(BOOL)scrollToTop completionHandler:(void (^ __nullable)(void))completionHandler __attribute__((deprecated("use `playTheIndexPath:scrollPosition:animated:completionHandler:` instead.")));
/**
Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
@param orientation UIInterfaceOrientation
@param animated is animated.
@param completion rotating completed callback.
*/
- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated completion:(void(^ __nullable)(void))completion __attribute__((deprecated("use `rotateToOrientation:animated:completion:` instead.")));
/**
Enter the fullScreen while the ZFFullScreenMode is ZFFullScreenModeLandscape.
@param orientation UIInterfaceOrientation
@param animated is animated.
*/
- (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated __attribute__((deprecated("use `rotateToOrientation:animated:` instead.")));
/**
Add to the keyWindow.
*/
- (void)addPlayerViewToKeyWindow __attribute__((deprecated("use `addPlayerViewToSmallFloatView` instead.")));;
@end
NS_ASSUME_NONNULL_END