PlayView.m 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // PlayView.m
  3. // XMEye
  4. //
  5. // Created by XM on 2018/7/21.
  6. // Copyright © 2018年 Megatron. All rights reserved.
  7. //
  8. #import "PlayView.h"
  9. @implementation PlayView
  10. - (id)initWithFrame:(CGRect)frame {
  11. self = [super initWithFrame:frame];
  12. self.backgroundColor = [UIColor blackColor];
  13. _activityView = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0, 0, 30, 30)];
  14. _activityView.hidesWhenStopped = YES;
  15. [self addSubview:_activityView];
  16. return self;
  17. }
  18. #pragma mark 刷新界面图标
  19. - (void)refreshView {
  20. CGRect rect = self.frame;
  21. CGPoint point = CGPointMake(rect.size.width/2.0, rect.size.height/2.0);
  22. self.activityView.center = point;
  23. }
  24. - (void)playViewBufferIng { //正在缓冲
  25. [self.activityView startAnimating];
  26. }
  27. - (void)playViewBufferEnd {//缓冲完成
  28. [self.activityView stopAnimating];
  29. }
  30. - (void)playViewBufferStop {//预览失败
  31. [self.activityView stopAnimating];
  32. }
  33. +(Class)layerClass{
  34. return [CAEAGLLayer class];
  35. }
  36. @end