Esempio n. 1
0
        /// <summary>
        /// Stops playing the media file.
        /// </summary>
        private void Stop()
        {
            if (isStreaming)
            {
                if (rtspClient != null)
                {
                    bool result = rtspClient.TeardownStream();
                    if (!result)
                    {
                        Utils.OutputMessage(false, MsgLevel.Error, "ClientForm -- Stop", "Could not stop the stream!");
                        return;
                    }

                    result = rtspClient.DisconnectServer();
                    if (!result)
                    {
                        Utils.OutputMessage(false, MsgLevel.Error, "ClientForm -- Stop", "Could not disconnect the server!");
                        return;
                    }

                    Utils.OutputMessage(false, MsgLevel.Debug, "ClientForm -- Stop", "Stop the stream successfully.");
                }
            }

            if (ourVideo != null)
            {
                ourVideo.Stop();
            }

            currentState = PlayerState.Stopped;
            UpdateClientStatus();
        }