神刀安全网

KRVideoPlayer 优化视频播放


在”KRVideoPlayer”基础上加以优化,集成视频播放功能

Demo video 播放分两种情况:  1.加载到当前 view 上使用简单,不便于控制,实际运用有好多 Bug [self addSubview:self.videoController.view]  2.video 显示在 window 便于控制 [self.videoController showInWindow]

KRVideoPlayer 播放集成

        NSString *path = [[NSBundle mainBundle]pathForResource:@"150511_JiveBike.mov" ofType:nil];         NSURL *url = [NSURL fileURLWithPath:path];          self.videoController = [[KrVideoPlayerController alloc] initWithFrame:CGRectMake(0,0,Width,200)];         __weak typeof(self)weakSelf = self;         self.videoController.view.backgroundColor = [UIColor whiteColor];         [self.videoController setDimissCompleteBlock:^{             weakSelf.videoController = nil;         }];         [self.videoController setWillBackOrientationPortrait:^{                     [weakSelf toolbarHidden:NO];         }];         [self.videoController setWillChangeToFullscreenMode:^{                     [weakSelf toolbarHidden:YES];         }]; //        [self addSubview:self.videoController.view];  加载到当前 view 上使用简单         [self.videoController showInWindow]; //video 显示在 window 便于控制          self.videoController.contentURL = url;
KRVideoPlayer 优化视频播放

video.gif

QRGVideo Demo 在真机上运行体验更好

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » KRVideoPlayer 优化视频播放

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址