We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
let permissionBlock = {() -> Void in dispatch_async(self.sessionQueue!, {() -> Void in let videoCaptureConfiguration: PLVideoCaptureConfiguration = self.videoCaptureConfigurations!.last! let audioCaptureConfiguration: PLAudioCaptureConfiguration = PLAudioCaptureConfiguration.defaultConfiguration() // 视频编码配置 let videoStreamingConfiguration: PLVideoStreamingConfiguration = self.videoStreamingConfigurations!.last! // 音频编码配置 let audioStreamingConfiguration: PLAudioStreamingConfiguration = PLAudioStreamingConfiguration.defaultConfiguration() let orientation:AVCaptureVideoOrientation? = AVCaptureVideoOrientation(rawValue: UIDevice.currentDevice().orientation.rawValue) // 推流 session self.session = PLCameraStreamingSession(videoCaptureConfiguration: videoCaptureConfiguration, audioCaptureConfiguration: audioCaptureConfiguration, videoStreamingConfiguration: videoStreamingConfiguration, audioStreamingConfiguration: audioStreamingConfiguration, stream: stream, videoOrientation: orientation!) self.session!.delegate = self self.session!.bufferDelegate = self // UIImage *waterMark = [UIImage imageNamed:@"qiniu.png"]; // [self.session setWaterMarkWithImage:waterMark position:CGPointMake(100, 300)]; dispatch_async(dispatch_get_main_queue(), {() -> Void in let previewView: UIView = self.session!.previewView previewView.autoresizingMask = [.FlexibleHeight, .FlexibleWidth] self.view!.insertSubview(previewView, atIndex: 0) // self.zoomSlider.minimumValue = 1; // self.zoomSlider.maximumValue = MIN(5, self.session.videoActiveFormat.videoMaxZoomFactor); let log: String = String(format: "Zoom Range: [1..%.0f]", self.session!.videoActiveFormat.videoMaxZoomFactor) print("\(log)") // self.textView.text = [NSString stringWithFormat:@"%@\%@", self.textView.text, log]; // self.textView.text = [NSString stringWithFormat:@"%@\%@", self.textView.text, log]; }) }) // show countdown // self.performSelector(#selector(self.showCountdown), withObject: nil, afterDelay: 3.0) } let noAccessBlock = {() -> Void in Util.showAlertTitle(Constants.APP_NAME, message: "No Access") } switch PLCameraStreamingSession.cameraAuthorizationStatus() { case .Authorized: permissionBlock() case .NotDetermined: PLCameraStreamingSession.requestCameraAccessWithCompletionHandler({(granted: Bool) -> Void in granted ? permissionBlock() : noAccessBlock() }) default: noAccessBlock() } func cameraStreamingSession(session: PLCameraStreamingSession!, streamStatusDidUpdate status: PLStreamStatus!) { }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: