Closed kjoe07 closed 4 years ago
Closing the issue as it is tracked here. Feel free to reopen if you think otherwise.
the no data is about a vpn to make the connection. or a least a vpn provider using siphon vpn in iOS 13.3.1 and 13.4 so is not further help needed with this, thanks
Description
after conected two apps no audio or video is shared, after update to adopt lates sdk.
Steps to Reproduce
Code
` // // VideoCallViewController.swift // TheHomeTeachers // // Created by SofticSolutions on 06/04/18. // Copyright © 2018 Bruno Hernandez. All rights reserved. //
import AVKit import UIKit import TwilioVideo import ReplayKit import Sketch import UserNotifications import SwiftyDraw class PruebaViewController: UIViewController, ButtonViewInterface, UNUserNotificationCenterDelegate,CameraSourceDelegate{
// let centerX = NSLayoutConstraint(item: self.remoteView!,attribute: NSLayoutConstraint.Attribute.centerX,relatedBy: NSLayoutConstraint.Relation.equal,toItem: self.view,attribute: NSLayoutConstraint.Attribute.centerX,multiplier: 1,constant: 0); // self.view.addConstraint(centerX) // let centerY = NSLayoutConstraint(item: self.remoteView!,attribute: NSLayoutConstraint.Attribute.centerY,relatedBy: NSLayoutConstraint.Relation.equal,toItem: self.view,attribute: NSLayoutConstraint.Attribute.centerY,multiplier: 1,constant: 0); // self.view.addConstraint(centerY) // let width = NSLayoutConstraint(item: self.remoteView!,attribute: NSLayoutConstraint.Attribute.width,relatedBy: NSLayoutConstraint.Relation.equal,toItem: self.view,attribute: NSLayoutConstraint.Attribute.width,multiplier: 1,constant: 0); // self.view.addConstraint(width) // let height = NSLayoutConstraint(item: self.remoteView!,attribute: NSLayoutConstraint.Attribute.height,relatedBy: NSLayoutConstraint.Relation.equal,toItem: self.view,attribute: NSLayoutConstraint.Attribute.height,multiplier: 1,constant: 0); // self.view.addConstraint(height) }
func teardownLocalMedia() { if let renderer = remoteView { screenTrack?.removeRenderer(renderer) } screenTrack = nil }
}
// MARK: UITextFieldDelegate extension PruebaViewController : UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { //self.connect(sender: textField) return true } }
// MARK: TVIRoomDelegate extension PruebaViewController : RoomDelegate { func roomDidConnect(room: Room) { // The Local Participant if let localParticipant = room.localParticipant { print("Local identity (localParticipant.identity)") } let participants = room.remoteParticipants for remoteParticipant in room.remoteParticipants { remoteParticipant.delegate = self } print("Number of connected Participants (participants.count)") } func roomDidDisconnect(room: Room, error: Error?) { logMessage(messageText: "Disconncted from room (room.name), error = (String(describing: error))") self.cleanupRemoteParticipant() self.room = nil self.showRoomUI(inRoom: false) } func roomDidStartRecording(room: Room) { print("recording") }
}
// MARK: TVIParticipantDelegate extension PruebaViewController : RemoteParticipantDelegate { func remoteParticipantDidPublishVideoTrack(participant: RemoteParticipant, publication: RemoteVideoTrackPublication) { // Remote Participant has offered to share the video Track. logMessage(messageText: "Participant (participant.identity) published (publication.trackName) video track") }
}
// MARK: TVIVideoViewDelegate extension PruebaViewController : VideoViewDelegate { func videoViewDimensionsDidChange(view: VideoView, dimensions: CMVideoDimensions) { self.view.setNeedsLayout() } func videoViewDidReceiveData(view: VideoView) { if (view == remoteView) { remoteView?.isHidden = false self.view.setNeedsLayout() } } }
// MARK: TVICameraCapturerDelegate //extension PruebaViewController : TVICameraCapturerDelegate { // func cameraCapturer(_ capturer: TVICameraCapturer, didStartWith source: TVICameraCaptureSource) { // self.previewView.shouldMirror = (source == .frontCamera) // } //}
extension PruebaViewController { func tapPenButton() { sketchView.drawTool = .pen }
} extension PruebaViewController: RPScreenRecorderDelegate { func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) { if Thread.isMainThread { // Assume we will get an error raised if we are actively broadcasting / capturing and access is "stolen". if (screenTrack == nil) { checkRecordingAvailability() } } else { DispatchQueue.main.async { self.screenRecorderDidChangeAvailability(screenRecorder) } } } } `
class VideoCallViewController: UIViewController, ButtonViewInterface{ // MARK: View Controller Members
// @IBOutlet weak var previewView: VideoView! @IBOutlet weak var disconnectButton: UIButton! @IBOutlet weak var micButton: UIButton! @IBOutlet weak var stack: UIStackView! @IBOutlet weak var scrollView: UIScrollView! @IBOutlet weak var sketchView: SketchView! var buttonView: ButtonView! // var scrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width + 50, height: 50)) var screenCapturer: VideoSource?//TVIVideoCapturer? @IBOutlet weak var screenView: UIView! var pantalla = 1 let useExampleCapturer = false
// sketchView = SketchView(frame: CGRect(x: 0,y: 0,width: UIScreen.main.bounds.width,height: UIScreen.main.bounds.height - 60)) // sketchView.translatesAutoresizingMaskIntoConstraints = false // screenView.addSubview(sketchView)
// scrollView.contentSize = buttonView.frame.size // scrollView.showsHorizontalScrollIndicator = false // scrollView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 5).isActive = true // scrollView.leftAnchor.constraint(equalTo: view.leftAnchor, constant: 10).isActive = true // scrollView.heightAnchor.constraint(equalToConstant: 50).isActive = true //scrollView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: -10).isActive = true //self.startPreview() // Disconnect and mic button will be displayed when the Client is connected to a Room. self.disconnectButton.isHidden = true self.micButton.isHidden = true
// sketchView.translatesAutoresizingMaskIntoConstraints = false //screenView.addSubview(sketchView) // view.addSubview(scrollView) // scrollView.addSubview(buttonView) // scrollView.contentSize = buttonView.frame.size // scrollView.showsHorizontalScrollIndicator = false // scrollView.translatesAutoresizingMaskIntoConstraints = false // scrollView.bottomAnchor.constraint(equalTo: view.safeAreaLayoutGuide.bottomAnchor, constant: 5).isActive = true // scrollView.leftAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leftAnchor, constant: 10).isActive = true // scrollView.rightAnchor.constraint(equalTo: stack.rightAnchor, constant: 20).isActive = true // scrollView.heightAnchor.constraint(equalToConstant: 50).isActive = true // sketchView.topAnchor.constraint(equalTo: screenView.topAnchor, constant: 0).isActive = true // sketchView.leftAnchor.constraint(equalTo: screenView.leftAnchor, constant: 0).isActive = true // sketchView.rightAnchor.constraint(equalTo: screenView.rightAnchor, constant: 0).isActive = true // sketchView.bottomAnchor.constraint(equalTo: screenView.bottomAnchor, constant: 0).isActive = true // scrollView.frame.origin.x = 0 // scrollView.frame.origin.y = UIScreen.main.bounds.height - buttonView.frame.size.height - 24 } private func startConference() { // Start recording the screen. let recorder = RPScreenRecorder.shared() recorder.isMicrophoneEnabled = true recorder.isCameraEnabled = false recorder.discardRecording { print("eliminando la grabacion si es que existia alguna") } if recorder.isRecording{ recorder.stopCapture(handler: { e in print("elimando la captura") }) recorder.stopRecording(handler: { _,e in print("stop rrecording",e?.localizedDescription ?? "no error")
// builder.audioTracks = [LocalAudioTrack()!] if let audioTracks = self.localAudioTrack{ builder.audioTracks = [audioTracks] } if let videoTrack = self.screenTrack { builder.videoTracks = [videoTrack] }
// let centerX = NSLayoutConstraint(item: self.remoteView!,attribute: NSLayoutConstraint.Attribute.centerX,relatedBy: NSLayoutConstraint.Relation.equal,toItem: self.view,attribute: NSLayoutConstraint.Attribute.centerX, multiplier: 1, constant: 0); // self.view.addConstraint(centerX) // let centerY = NSLayoutConstraint(item: self.remoteView!, // attribute: NSLayoutConstraint.Attribute.centerY, // relatedBy: NSLayoutConstraint.Relation.equal, // toItem: self.view, // attribute: NSLayoutConstraint.Attribute.centerY, // multiplier: 1, // constant: 0); // self.view.addConstraint(centerY) // let width = NSLayoutConstraint(item: self.remoteView!, // attribute: NSLayoutConstraint.Attribute.width, // relatedBy: NSLayoutConstraint.Relation.equal, // toItem: self.view, // attribute: NSLayoutConstraint.Attribute.width, // multiplier: 1, // constant: 0); // self.view.addConstraint(width) // let height = NSLayoutConstraint(item: self.remoteView!, // attribute: NSLayoutConstraint.Attribute.height, // relatedBy: NSLayoutConstraint.Relation.equal, // toItem: self.view, // attribute: NSLayoutConstraint.Attribute.height, // multiplier: 1, // constant: 0); // self.view.addConstraint(height) }
}
// MARK: UITextFieldDelegate extension VideoCallViewController : UITextFieldDelegate { func textFieldShouldReturn(_ textField: UITextField) -> Bool { //self.connect(sender: textField) return true } }
// MARK: TVIRoomDelegate extension VideoCallViewController : RoomDelegate { func roomDidConnect(room: Room) { // The Local Participant if let localParticipant = room.localParticipant { print("Local identity (localParticipant.identity)") } // Connected participants let participants = room.remoteParticipants for remoteParticipant in room.remoteParticipants { remoteParticipant.delegate = self } print("Number of connected Participants (participants.count)") } func roomDidDisconnect(room: Room, error: Error?) { logMessage(messageText: "Disconncted from room (room.name), error = (String(describing: error))") self.cleanupRemoteParticipant() self.room = nil self.showRoomUI(inRoom: false) } func roomDidFailToConnect(room: Room, error: Error) { print("Failed to connect to room with error",error.localizedDescription) self.room = nil self.showRoomUI(inRoom: false) } func participantDidConnect(room: Room, participant: RemoteParticipant) { participant.delegate = self print("Participant connected: (participant.identity)") } func participantDidDisconnect(room: Room, participant: RemoteParticipant) { logMessage(messageText: "Room (room.name), Participant (participant.identity) disconnected") }
}
// MARK: TVIParticipantDelegate extension VideoCallViewController : RemoteParticipantDelegate { func remoteParticipantDidPublishVideoTrack(participant: RemoteParticipant, publication: RemoteVideoTrackPublication) { // Remote Participant has offered to share the video Track. logMessage(messageText: "Participant (participant.identity) published (publication.trackName) video track") }
}
// MARK: TVIVideoViewDelegate extension VideoCallViewController : VideoViewDelegate { func videoViewDimensionsDidChange(view: VideoView, dimensions: CMVideoDimensions) { self.view.setNeedsLayout() } }
// MARK: TVICameraCapturerDelegate // extension VideoCallViewController : TVICameraCapturerDelegate { // func cameraCapturer(_ capturer: TVICameraCapturer, didStartWith source: TVICameraCaptureSource) { // self.previewView.shouldMirror = (source == .frontCamera) // } // }
extension VideoCallViewController { @IBAction func tapPenButton() { sketchView.drawTool = .pen }
} extension VideoCallViewController: RPScreenRecorderDelegate { func screenRecorderDidChangeAvailability(_ screenRecorder: RPScreenRecorder) { if Thread.isMainThread { // Assume we will get an error raised if we are actively broadcasting / capturing and access is "stolen". if (screenTrack == nil) { checkRecordingAvailability() } } else { DispatchQueue.main.async { self.screenRecorderDidChangeAvailability(screenRecorder) } } } } `
Expected Behavior
ear to view remote screen video but no luck, no sound or video
Actual Behavior
conectaron to the room is made but no video or audio, in console this logs from delegate.
Reproduces How Often
always, tried to change let recorder = RPScreenRecorder.shared() recorder.isMicrophoneEnabled = true to try audio but even no make a difference, some moments it was seen audio and video, but the method were wrong
Logs
Versions
Voice iOS SDK
[ 3.1.0 via CocoaPods]
Xcode
[11.3.1]
iOS Version
[13.3.1]
iOS Device
[e.g. iPhone 7 Plus, iPad Pro]