PlayerView.m 493 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // PlayerView.m
  3. // VIMediaCacheDemo
  4. //
  5. // Created by Vito on 5/17/16.
  6. // Copyright © 2016 Vito. All rights reserved.
  7. //
  8. #import "PlayerView.h"
  9. @implementation PlayerView
  10. + (Class)layerClass {
  11. return [AVPlayerLayer class];
  12. }
  13. - (AVPlayer*)player {
  14. return [(AVPlayerLayer *)[self layer] player];
  15. }
  16. - (void)setPlayer:(AVPlayer *)player {
  17. [(AVPlayerLayer *)[self layer] setPlayer:player];
  18. }
  19. - (AVPlayerLayer *)playerLayer
  20. {
  21. return (AVPlayerLayer *)self.layer;
  22. }
  23. @end