/// <summary>
        /// Creates Live Streaming infrastructure and starts everything
        /// </summary>
        /// <returns></returns>
        public static bool Start(StartAMSConfigParams configParams)
        {
            bool tempresult = true;

            try
            {
                //Create Live Streaming infrastructure
                CreateLiveStreamingInfrastructure(configParams);
                //Starts the aChannelName to allow incoming streams
                StartChannel(configParams.AChannelName);


                //Publishes the streaming
                var StartLSConfigParams = new StartLSAMSConfigParams(configParams.AProgramlName,
                    configParams.AStreamingEndpointName);
                StartLiveStreaming(StartLSConfigParams);
            }

            catch (Exception ex)
            {
                tempresult = false;
            }
            return tempresult;
        }
Example #2
0
 private void btnStartLiveStreaming_Click(object sender, EventArgs e)
 {
     var config = new StartLSAMSConfigParams(tbProgramName.Text, tbStreamingEndpointName.Text);
     VooAzureStreamFacade.VooAzureStreamFacade.StartLiveStreaming(config);
 }
        public static bool StartLiveStreaming(StartLSAMSConfigParams configParams)
        {
            bool tempresult = false;
            //Set Azure credentials
            if (_context == null)
                SetMediaServicesCredentials();
            try
            {

            //Start the Program
            IProgram aProgram = _context.Programs.Where(p => p.Name == configParams.AProgramlName).FirstOrDefault();
            if (aProgram.State != ProgramState.Running)
            {
                aProgram.Start();
            }

           //Start the Streaming Endpoint
            IStreamingEndpoint aStreamingEndpoint = _context.StreamingEndpoints.Where(s => s.Name == configParams.AStreamingEndpointName).FirstOrDefault();
            if (aStreamingEndpoint.State != StreamingEndpointState.Running)
            {
                aStreamingEndpoint.Start();
            }
          
               // return result
                tempresult = true;
            }
            catch (Exception ex)
            {
                
            }

            return tempresult;
        }
 public void StartLiveStreaming(string aProgramName, string aStreamingEndpointName)
 {
     var config = new StartLSAMSConfigParams(aProgramName,aStreamingEndpointName);
     VooAzureStreamFacade.StartLiveStreaming(config);
 }