/// <summary> /// Unity start. /// </summary> private void Start() { SLog.SetLogger(OnLog); DebugHelper.ActivateConsole(); //use video and audio by default (the UI is toggled on by default as well it will change on click ) config.Video = true; config.Audio = true; }
protected virtual void Init() { if (uDebugConsole) { DebugHelper.ActivateConsole(); } if (uLog) { if (sLogSet == false) { SLog.SetLogger(OnLog); sLogSet = true; SLog.L("Log active"); } } //This can be used to get the native webrtc log but causes a huge slowdown //only use if not webgl bool nativeWebrtcLog = true; if (nativeWebrtcLog) { #if UNITY_ANDROID //uncomment for debug log via log cat //Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogLevel(WebRtcCSharp.LoggingSeverity.LS_INFO); #elif UNITY_IOS //uncomment for log output via xcode //Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogLevel(WebRtcCSharp.LoggingSeverity.LS_INFO); #elif (!UNITY_WEBGL || UNITY_EDITOR) Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogLevel(WebRtcCSharp.LoggingSeverity.LS_INFO); //Byn.Net.Native.NativeWebRtcNetworkFactory.SetNativeLogToSLog(WebRtcCSharp.LoggingSeverity.LS_INFO); #else //webgl. logging isn't supported here and has to be done via the browser. Debug.LogWarning("Platform doesn't support native webrtc logging."); #endif } if (UnityCallFactory.Instance == null) { Debug.LogError("UnityCallFactory failed to initialize"); } //not yet implemented //CustomUnityVideo.Instance.Register(); }
void Start() { DebugHelper.ActivateConsole(); if (WebRtcNetwork.IsAvailable() == false) { //if the libray isn't available this could mean the JS part of the library is missing //(wrong template, webrtcnetworplugin.js not included -> try adding it via ExternalEval) Append("Try to initialize WebRTCNetwork"); WebRtcNetwork.InjectJsCode(); } if (WebRtcNetwork.IsAvailable()) { //default version //mNetwork = new WebRtcNetwork(); //custom configuration mNetwork = new WebRtcNetwork(mWebRtcConfig); Append("WebRtcNetwork available"); } else { Append("WebRtcNetwork not available"); if (UnityNetwork.IsAvailable()) { mNetwork = UnityNetwork.Get(); Append("Using unity network instead. TESTING ONLY! You can't connect to browsers."); Append("Build a WebGL example to use WebRTC!"); } else { Append("No network module available. Build and run a WebGL version or switch the platform to Standalone to use the Debugversion."); } } }
/// <summary> /// Will setup webrtc and create the network object /// </summary> private void Start() { //shows the console on all platforms. for debugging only if (uDebugConsole) { DebugHelper.ActivateConsole(); } if (uLog) { SLog.SetLogger(OnLog); } SLog.LV("Verbose log is active!"); SLog.LD("Debug mode is active"); Append("Setting up WebRtcNetworkFactory"); WebRtcNetworkFactory factory = WebRtcNetworkFactory.Instance; if (factory != null) { Append("WebRtcNetworkFactory created"); } }
// Use this for initialization void Start() { DebugHelper.ActivateConsole(); Debug.Log("Started ..."); }