Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
9d376840
Commit
9d376840
authored
Dec 30, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小窗没登录不让展示,增加直播间避免提前加入直播间,总是获取新的token channel uid状态,增加加入失败日志
parent
4e291b8b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
2 deletions
+54
-2
YHAliYunLogManager.swift
...Classes/Modules/AliYunLog(阿里云日志)/YHAliYunLogManager.swift
+1
-0
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+4
-0
YHHomeBannerView.swift
.../galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
+2
-2
YHPlayerManager.swift
...ses/Modules/LivestreamSales(直播销售)/C/YHPlayerManager.swift
+47
-0
No files found.
galaxy/galaxy/Classes/Modules/AliYunLog(阿里云日志)/YHAliYunLogManager.swift
View file @
9d376840
...
...
@@ -26,6 +26,7 @@ enum YHModuleNameValue: String {
case
networkDataType
=
"networkDataType"
// 网络数据
case
h5InteractionType
=
"h5InteractionType"
// 与H5交互相关
case
clickType
=
"clickType"
// 用户点点击事件
case
logTypeError
=
"logTypeError"
// log失败状态
}
class
YHAliYunLogManager
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
9d376840
...
...
@@ -77,6 +77,10 @@ class YHHomePageViewController: YHBaseViewController {
super
.
viewWillAppear
(
animated
)
isTopMostAndVisible
=
true
YHPlayerManager
.
shared
.
handlePageChanged
(
isRecommendPage
:
true
)
// 没登录不让展示小窗
guard
YHLoginManager
.
shared
.
isLogin
()
else
{
return
}
guard
YHPlayerManager
.
shared
.
isConfigFloating
!=
false
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
View file @
9d376840
...
...
@@ -251,7 +251,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
// YHPlayerManager.shared.leaveChannel(for: player)
// player.clearPlayerView()
// }
let
playbackInfo
=
YHPlayerManager
.
PlaybackInfo
(
id
:
model
.
live_id
,
url
:
nil
,
title
:
nil
,
roomId
:
nil
,
token
:
model
.
token
,
channelId
:
model
.
rtmp_channel
,
uid
:
model
.
user_id
!=
0
?
UInt
(
model
.
user_id
)
:
nil
,
isLive
:
true
,
scene
:
.
fullscreen
)
let
playbackInfo
=
YHPlayerManager
.
PlaybackInfo
(
id
:
model
.
live_id
,
url
:
nil
,
title
:
nil
,
roomId
:
nil
,
token
:
nil
,
channelId
:
nil
,
uid
:
nil
,
isLive
:
true
,
scene
:
.
fullscreen
)
YHPlayerManager
.
shared
.
enterLive
(
from
:
cell
?
.
bannerImagV
,
playbackInfo
:
playbackInfo
)
printLog
(
"跳转直播"
)
case
101
:
//录播
...
...
@@ -276,7 +276,7 @@ extension YHHomeBannerView: FSPagerViewDataSource, FSPagerViewDelegate {
// player.clearPlayerView()
// }
let
cell
:
YHHomeBannerCollectionViewCell
?
=
pagerView
.
cellForItem
(
at
:
index
)
as?
YHHomeBannerCollectionViewCell
let
playbackInfo
=
YHPlayerManager
.
PlaybackInfo
(
id
:
model
.
live_id
,
url
:
model
.
live_pull_url
,
title
:
nil
,
roomId
:
nil
,
token
:
model
.
token
,
channelId
:
model
.
rtmp_channel
,
uid
:
UInt
(
model
.
user_id
)
,
isLive
:
true
,
scene
:
.
fullscreen
)
let
playbackInfo
=
YHPlayerManager
.
PlaybackInfo
(
id
:
model
.
live_id
,
url
:
nil
,
title
:
nil
,
roomId
:
nil
,
token
:
nil
,
channelId
:
nil
,
uid
:
nil
,
isLive
:
true
,
scene
:
.
fullscreen
)
YHPlayerManager
.
shared
.
enterLive
(
from
:
cell
?
.
bannerImagV
,
playbackInfo
:
playbackInfo
)
case
0
:
//0 不需要跳转
printLog
(
"0 不需要跳转"
)
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHPlayerManager.swift
View file @
9d376840
...
...
@@ -251,6 +251,28 @@ class YHPlayerManager: NSObject {
}
if
result
==
0
{
player
.
setJoinInfo
(
token
:
token
,
channelId
:
channelId
,
uid
:
uid
)
}
else
{
//-2: #AgoraErrorCodeInvalidArgument
//-3: #AgoraErrorCodeNotReady
//-5: #AgoraErrorCodeRefused
var
errorMsg
=
"加入失败"
switch
result
{
case
-
2
:
errorMsg
=
"AgoraErrorCodeInvalidArgument"
case
-
3
:
errorMsg
=
"AgoraErrorCodeNotReady"
case
-
5
:
errorMsg
=
"AgoraErrorCodeRefused"
default
:
break
}
let
dic
:
[
AnyHashable
:
Any
]
=
[
"type"
:
"joinLiveChannelError"
,
"channelId"
:
channelId
,
"uid"
:
uid
,
"errorMsg"
:
errorMsg
]
YHAliYunLogManager
.
shared
.
addModuleName
(
.
logTypeError
,
remark
:
dic
)
}
}
else
{
mainChannelDelegate
?
.
channelId
=
channelId
...
...
@@ -266,6 +288,28 @@ class YHPlayerManager: NSObject {
joinSuccess
:
nil
)
if
result
==
0
{
player
.
setJoinInfo
(
token
:
token
,
channelId
:
channelId
,
uid
:
uid
)
}
else
{
//-2: #AgoraErrorCodeInvalidArgument
//-3: #AgoraErrorCodeNotReady
//-5: #AgoraErrorCodeRefused
var
errorMsg
=
"加入失败"
switch
result
{
case
-
2
:
errorMsg
=
"AgoraErrorCodeInvalidArgument"
case
-
3
:
errorMsg
=
"AgoraErrorCodeNotReady"
case
-
5
:
errorMsg
=
"AgoraErrorCodeRefused"
default
:
break
}
let
dic
:
[
AnyHashable
:
Any
]
=
[
"type"
:
"joinLiveChannelError"
,
"channelId"
:
channelId
,
"uid"
:
uid
,
"errorMsg"
:
errorMsg
]
YHAliYunLogManager
.
shared
.
addModuleName
(
.
logTypeError
,
remark
:
dic
)
}
}
}
...
...
@@ -420,6 +464,7 @@ class YHPlayerManager: NSObject {
}
}
/*
// 加入频道
if let token = playbackInfo.token,
let channelId = playbackInfo.channelId, let uid = playbackInfo.uid, !token.isEmpty, !channelId.isEmpty {
...
...
@@ -434,6 +479,8 @@ class YHPlayerManager: NSObject {
joinChannel(for: player, token: token, channelId: channelId, uid: uid, view: playerVC.playerView)
}
}
*/
leaveChannel
(
for
:
player
)
if
let
lastNav
=
lastNav
,
lastLiveVC
!=
nil
{
lastNav
.
viewControllers
.
removeAll
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment