Ejemplo n.º 1
0
        /// <summary>
        /// Begins the live stream using the information previously set in the FLVEncoderParams.
        /// If there was an error connecting to the server, than false is returned.
        /// </summary>
        /// <returns>True if encoding has begun properly / safely.</returns>
        public bool BeginLiveStream(string[] c_params)
        {
            if (!streamFile)
            {
                timer = new HighPerformanceTimer();
                timer.Start(); //begin our timer (times are encoded).
                this.frameCount = 0;
            }

            Console.WriteLine(this.EncoderParameters.StreamingParams.Protocol);
            client = ConnectionProtocol.getProtocolHandler(
                this.EncoderParameters.StreamingParams.Protocol);
            client.ConnectionParameters = this.EncoderParameters.StreamingParams;
            Console.WriteLine("Connecting with: " + client.ProtocolName);
            if (!client.connect(c_params))
            {
                return(false);
            }



            //turn on live streaming
            this.streamLive = true;

            //set the encoding progress to true
            this.encodeInProgress = true;

            //return success
            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Begins the live stream using the information previously set in the FLVEncoderParams.
        /// If there was an error connecting to the server, than false is returned.
        /// </summary>
        /// <returns>True if encoding has begun properly / safely.</returns>
        public bool BeginLiveStream(string[] c_params)
        {

            if (!streamFile)
            {
                timer = new HighPerformanceTimer();
                timer.Start(); //begin our timer (times are encoded).
                this.frameCount = 0;
            }

            Console.WriteLine(this.EncoderParameters.StreamingParams.Protocol);
            client = ConnectionProtocol.getProtocolHandler(
                this.EncoderParameters.StreamingParams.Protocol);
            client.ConnectionParameters = this.EncoderParameters.StreamingParams;
            Console.WriteLine("Connecting with: " + client.ProtocolName);
            if (!client.connect(c_params))
            {
                return false;
            }
           
            
            

            //turn on live streaming
            this.streamLive = true;

            //set the encoding progress to true
            this.encodeInProgress = true;

            //return success
            return true;
        }