示例#1
0
        private async Task StartOrRefreshLiveAsync()
        {
            if (ViewFrameList.Count(viewFrame => viewFrame.IsOpened && viewFrame.Visibility == Visibility.Visible) > 0)
            {
                if (_sdkService.IsCreator && !_serverPushLiveService.HasPushLiveSuccessfully &&
                    (_lessonDetail.LessonType == LessonType.Interactive ||
                     _lessonDetail.LessonType == LessonType.Discussion))
                {
                    _serverPushLiveService.HasPushLiveSuccessfully = true;
                    await StartPushLiveStreamAutomatically();
                }

                if (_localPushLiveService.LiveId != 0)
                {
                    _localPushLiveService.RefreshLiveStream(GetStreamLayout(
                                                                _localPushLiveService.LiveParam.Width,
                                                                _localPushLiveService.LiveParam.Height));
                }

                if (_serverPushLiveService.LiveId != 0)
                {
                    _serverPushLiveService.RefreshLiveStream(
                        GetStreamLayout(_serverPushLiveService.LiveParam.Width,
                                        _serverPushLiveService.LiveParam.Height));
                }

                if (_localRecordService.RecordId != 0)
                {
                    _localRecordService.RefreshLiveStream(GetStreamLayout(_localRecordService.RecordParam.Width,
                                                                          _localRecordService.RecordParam.Height));
                }
            }
        }
示例#2
0
        private async Task StartOrRefreshLiveAsync()
        {
            try
            {
                if (ViewFrameList.Count(viewFrame => viewFrame.IsOpened && viewFrame.Visibility == Visibility.Visible) > 0)
                {
                    if (_manualPushLive.LiveId != 0)
                    {
                        await
                        _manualPushLive.RefreshLiveStream(GetStreamLayout(
                                                              _manualPushLive.LiveParam.Width,
                                                              _manualPushLive.LiveParam.Height));
                    }

                    if (_serverPushLive.LiveId != 0 && _serverPushLive.LiveParam != null)
                    {
                        await
                        _serverPushLive.RefreshLiveStream(
                            GetStreamLayout(_serverPushLive.LiveParam.Width,
                                            _serverPushLive.LiveParam.Height));
                    }

                    if (_localRecordLive.RecordId != 0)
                    {
                        var reuslt = await
                                     _localRecordLive.RefreshLiveStream(GetStreamLayout(_localRecordLive.RecordParam.Width,
                                                                                        _localRecordLive.RecordParam.Height));

                        if (ClassMode == ClassMode.ShareMode)
                        {
                            Log.Logger.Information($"文档共享模式刷新流结果:{reuslt.Status}--{reuslt.Message}");
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Logger.Error("邀请进入失败" + ex.Message);
            }
        }