示例#1
0
        private async void OnNetConnectionStatusUpdated(object sender, NetStatusUpdatedEventArgs args)
        {
            var ncs = args.NetStatusCode;

            if (ncs == NetStatusCodeType.NetConnectionConnectSuccess)
            {
                _Stream                = new NetStream();
                _Stream.Attached      += OnAttached;
                _Stream.StatusUpdated += OnNetStreamStatusUpdated;
                _Stream.AudioStarted  += OnAudioStarted;
                _Stream.VideoStarted  += OnVideoStarted;

                _BufferingHelper = new BufferingHelper(_Stream);

                // createStream
                await _Stream.AttachAsync(_Connection);

                // nlPlayNotice(チャンネル/ユーザー生放送のライブ配信のみ)
                await _ConnectionImpl.PostConnectionProcess(_Connection);
            }
            else if ((ncs & NetStatusCodeType.Level2Mask) == NetStatusCodeType.NetConnectionConnect)
            {
                Close();
                Stopped?.Invoke(new NicovideoRtmpClientStoppedEventArgs());
            }
        }