ZFPlayer.h 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. //
  2. // ZFPlayer.h
  3. // ZFPlayer
  4. //
  5. // Copyright (c) 2016年 任子丰 ( http://github.com/renzifeng )
  6. //
  7. // Permission is hereby granted, free of charge, to any person obtaining a copy
  8. // of this software and associated documentation files (the "Software"), to deal
  9. // in the Software without restriction, including without limitation the rights
  10. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  11. // copies of the Software, and to permit persons to whom the Software is
  12. // furnished to do so, subject to the following conditions:
  13. //
  14. // The above copyright notice and this permission notice shall be included in
  15. // all copies or substantial portions of the Software.
  16. //
  17. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  18. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  19. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  20. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  21. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  22. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  23. // THE SOFTWARE.
  24. #import <Foundation/Foundation.h>
  25. //! Project version number for ZFPlayer.
  26. FOUNDATION_EXPORT double ZFPlayerVersionNumber;
  27. //! Project version string for ZFPlayer.
  28. FOUNDATION_EXPORT const unsigned char ZFPlayerVersionString[];
  29. /**
  30. Synthsize a weak or strong reference.
  31. Example:
  32. @weakify(self)
  33. [self doSomething^{
  34. @strongify(self)
  35. if (!self) return;
  36. ...
  37. }];
  38. */
  39. #ifndef weakify
  40. #if DEBUG
  41. #if __has_feature(objc_arc)
  42. #define weakify(object) autoreleasepool{} __weak __typeof__(object) weak##_##object = object;
  43. #else
  44. #define weakify(object) autoreleasepool{} __block __typeof__(object) block##_##object = object;
  45. #endif
  46. #else
  47. #if __has_feature(objc_arc)
  48. #define weakify(object) try{} @finally{} {} __weak __typeof__(object) weak##_##object = object;
  49. #else
  50. #define weakify(object) try{} @finally{} {} __block __typeof__(object) block##_##object = object;
  51. #endif
  52. #endif
  53. #endif
  54. #ifndef strongify
  55. #if DEBUG
  56. #if __has_feature(objc_arc)
  57. #define strongify(object) autoreleasepool{} __typeof__(object) object = weak##_##object;
  58. #else
  59. #define strongify(object) autoreleasepool{} __typeof__(object) object = block##_##object;
  60. #endif
  61. #else
  62. #if __has_feature(objc_arc)
  63. #define strongify(object) try{} @finally{} __typeof__(object) object = weak##_##object;
  64. #else
  65. #define strongify(object) try{} @finally{} __typeof__(object) object = block##_##object;
  66. #endif
  67. #endif
  68. #endif
  69. // Screen width
  70. #define ZFPlayerScreenWidth [[UIScreen mainScreen] bounds].size.width
  71. // Screen height
  72. #define ZFPlayerScreenHeight [[UIScreen mainScreen] bounds].size.height
  73. #import "ZFPlayerController.h"
  74. #import "ZFPlayerGestureControl.h"
  75. #import "ZFPlayerMediaPlayback.h"
  76. #import "ZFPlayerMediaControl.h"
  77. #import "ZFOrientationObserver.h"
  78. #import "ZFKVOController.h"
  79. #import "UIScrollView+ZFPlayer.h"
  80. #import "ZFPlayerLogManager.h"