protected override void OnEnable()
        {
            if (context == null)
            {
                context = GetComponentInParent <CameraConfigContext>();
            }

            if (AudioCallbackObject == null)
            {
                if (transform.childCount > 0)
                {
                    AudioCallbackObject = transform.GetChild(0).gameObject;
                }
                else
                {
                    AudioCallbackObject = gameObject;
                }
            }


            var cameraSpecific = context.Data != null &&
                                 context.Data.recordingData.perCamStreamService != MixCastData.StreamingService.None;

            _uriOutput = cameraSpecific ?
                         StreamingServiceUtility.ConstructStreamUrl(context.Data.recordingData, debug) :
                         StreamingServiceUtility.ConstructStreamUrl(MixCast.Settings.global, debug);

            base.OnEnable();

            if (encoderRunning == true)
            {
                AudioCallbackObject.SetActive(true);
            }
        }
Exemple #2
0
        static void AutoStartStreaming(MixCastData.CameraCalibrationData cam)
        {
            if (!cam.recordingData.autoStartStreaming)
            {
                return;
            }

            var cameraStreamUrl = StreamingServiceUtility.ConstructStreamUrl(cam.recordingData);
            var globalStreamUrl = StreamingServiceUtility.ConstructStreamUrl(Settings.global);

            var isStreamingConfigured = !string.IsNullOrEmpty(cameraStreamUrl) ||
                                        !string.IsNullOrEmpty(globalStreamUrl);

            if (!isStreamingConfigured)
            {
                return;
            }

            StreamingCameras.Add(cam);
        }