Exemple #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            var config = new StopAMSConfigParams(tbChannelName.Text, tbStreamingEndpointName.Text);
            bool tempresult =
                VooAzureStreamFacade.VooAzureStreamFacade.ReleaseLiveStreamingInfrastructure(config);

            //  MessageBox.Show(tempresult.ToString(), "Destroy Live Streaming infrastructure", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
        /// <summary>
        /// Stop the aChannelName and clean up the resources
        /// </summary>
        /// <returns></returns>
        public static bool Stop(StopAMSConfigParams configParams)
        {
            bool tempresult = true;

            try
            {
                ReleaseLiveStreamingInfrastructure(configParams);
            }

            catch (Exception ex)
            {
                tempresult = false;
            }
            return tempresult;
        }
        public bool Stop(string aChannelName, string anEndPointName)
        {
            var config = new StopAMSConfigParams(aChannelName, anEndPointName);

            return VooAzureStreamFacade.Stop(config);
        }
        public static bool ReleaseLiveStreamingInfrastructure(StopAMSConfigParams configParams)
        {
            bool tempresult = true;
            try
            {
                //Set Azure credentials
                if (_context == null)
                    SetMediaServicesCredentials();

                 IChannel channel = _context.Channels.Where(c => c.Name == configParams.AChannelName).FirstOrDefault();
                 IStreamingEndpoint streamingEndpoint = _context.StreamingEndpoints.Where(s => s.Name == configParams.AStreamingEndpointName).FirstOrDefault();;
               
                // Once you are done streaming, clean up your resources.
                Cleanup(streamingEndpoint, channel.Name);
            }
            catch (Exception ex)
            {
                tempresult = false;
            }
            return tempresult;
        }
 public bool ReleaseLiveStreamingInfrastructure(string aChannelName, string anEndPointName)
 {
     var config = new StopAMSConfigParams(aChannelName, anEndPointName);
     return VooAzureStreamFacade.ReleaseLiveStreamingInfrastructure(config);
 }