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
9bae58cc
Commit
9bae58cc
authored
Dec 07, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
录播页bug修复
parent
dbd9551d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
162 additions
and
13 deletions
+162
-13
YHMainChannelDelegate.swift
...dules/LivestreamSales(直播销售)/C/YHMainChannelDelegate.swift
+116
-4
YHVODPlayerViewController.swift
...s/LivestreamSales(直播销售)/C/YHVODPlayerViewController.swift
+26
-9
YHPlayerTopBarView.swift
.../Modules/LivestreamSales(直播销售)/V/YHPlayerTopBarView.swift
+17
-0
YHVideoProgressControl.swift
...ules/LivestreamSales(直播销售)/V/YHVideoProgressControl.swift
+3
-0
No files found.
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHMainChannelDelegate.swift
View file @
9bae58cc
...
...
@@ -53,6 +53,62 @@ class YHMainChannelDelegate: NSObject, AgoraRtcEngineDelegate {
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
firstRemoteVideoFrameOfUid
uid
:
UInt
,
size
:
CGSize
,
elapsed
:
Int
)
{
printLog
(
"$$$$###firstRemoteVideoFrameOfUid:
\(
size
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didOccurError
errorCode
:
AgoraErrorCode
)
{
printLog
(
"$$$$###didOccurError:
\(
errorCode
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didLeaveChannelWith
stats
:
AgoraChannelStats
)
{
printLog
(
"$$$$###didLeaveChannelWith
\(
stats
)
"
)
}
func
rtcEngineVideoDidStop
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineVideoDidStop"
)
}
func
rtcEngineConnectionDidInterrupted
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidInterrupted"
)
}
func
rtcEngineConnectionDidLost
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidLost"
)
}
func
rtcEngineConnectionDidBanned
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidBanned"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
networkTypeChanged
type
:
AgoraNetworkType
)
{
printLog
(
"$$$$###networkTypeChanged type:
\(
type
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
permissionError
type
:
AgoraPermissionType
)
{
printLog
(
"$$$$###permissionError type:
\(
type
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
connectionChangedTo
state
:
AgoraConnectionState
,
reason
:
AgoraConnectionChangedReason
)
{
printLog
(
"$$$$###connectionChangedTo state:
\(
state
)
reason:
\(
reason
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
reportRtcStats
stats
:
AgoraChannelStats
)
{
printLog
(
"$$$$###reportRtcStats:
\(
stats
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
lastmileQuality
quality
:
AgoraNetworkQuality
)
{
printLog
(
"$$$$###lastmileQuality:
\(
quality
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
lastmileProbeTest
result
:
AgoraLastmileProbeResult
)
{
printLog
(
"$$$$###lastmileProbeTest:
\(
result
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didOccur
errorType
:
AgoraEncryptionErrorType
)
{
printLog
(
"$$$$###didOccur errorType:
\(
errorType
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
rtmpStreamingChangedToState
url
:
String
,
state
:
AgoraRtmpStreamingState
,
reason
:
AgoraRtmpStreamingReason
)
{
printLog
(
"$$$$###rtmpStreamingChangedToState:
\(
state
)
url:
\(
url
)
"
)
}
}
class
YHSecondaryChannelDelegate
:
NSObject
,
AgoraRtcEngineDelegate
{
...
...
@@ -60,7 +116,7 @@ class YHSecondaryChannelDelegate: NSObject, AgoraRtcEngineDelegate {
weak
var
player
:
YHPlayer
?
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didJoinChannel
channel
:
String
,
withUid
uid
:
UInt
,
elapsed
:
Int
)
{
printLog
(
"secondary channel: local user join room
\(
channelId
??
""
)
:
\(
uid
)
\(
elapsed
)
ms"
)
printLog
(
"
$$$$###
secondary channel: local user join room
\(
channelId
??
""
)
:
\(
uid
)
\(
elapsed
)
ms"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didJoinedOfUid
uid
:
UInt
,
elapsed
:
Int
)
{
...
...
@@ -68,7 +124,7 @@ class YHSecondaryChannelDelegate: NSObject, AgoraRtcEngineDelegate {
let
player
=
player
,
let
view
=
player
.
currentPlayView
else
{
return
}
printLog
(
"secondary channel: remote user join room
\(
channelId
)
:
\(
uid
)
\(
elapsed
)
ms"
)
printLog
(
"
$$$$###
secondary channel: remote user join room
\(
channelId
)
:
\(
uid
)
\(
elapsed
)
ms"
)
let
videoCanvas
=
AgoraRtcVideoCanvas
()
videoCanvas
.
uid
=
uid
...
...
@@ -85,7 +141,7 @@ class YHSecondaryChannelDelegate: NSObject, AgoraRtcEngineDelegate {
guard
let
channelId
=
channelId
,
let
player
=
player
else
{
return
}
printLog
(
"secondary channel: remote user left:
\(
uid
)
reason
\(
reason
)
"
)
printLog
(
"
$$$$###
secondary channel: remote user left:
\(
uid
)
reason
\(
reason
)
"
)
let
videoCanvas
=
AgoraRtcVideoCanvas
()
videoCanvas
.
uid
=
uid
...
...
@@ -106,6 +162,62 @@ class YHSecondaryChannelDelegate: NSObject, AgoraRtcEngineDelegate {
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
firstRemoteVideoFrameOfUid
uid
:
UInt
,
size
:
CGSize
,
elapsed
:
Int
)
{
printLog
(
"###firstRemoteVideoFrameOfUid:
\(
size
)
"
)
printLog
(
"$$$$###firstRemoteVideoFrameOfUid:
\(
size
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didOccurError
errorCode
:
AgoraErrorCode
)
{
printLog
(
"$$$$###didOccurError:
\(
errorCode
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didLeaveChannelWith
stats
:
AgoraChannelStats
)
{
printLog
(
"$$$$###didLeaveChannelWith
\(
stats
)
"
)
}
func
rtcEngineVideoDidStop
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineVideoDidStop"
)
}
func
rtcEngineConnectionDidInterrupted
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidInterrupted"
)
}
func
rtcEngineConnectionDidLost
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidLost"
)
}
func
rtcEngineConnectionDidBanned
(
_
engine
:
AgoraRtcEngineKit
)
{
printLog
(
"$$$$###rtcEngineConnectionDidBanned"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
networkTypeChanged
type
:
AgoraNetworkType
)
{
printLog
(
"$$$$###networkTypeChanged type:
\(
type
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
permissionError
type
:
AgoraPermissionType
)
{
printLog
(
"$$$$###permissionError type:
\(
type
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
connectionChangedTo
state
:
AgoraConnectionState
,
reason
:
AgoraConnectionChangedReason
)
{
printLog
(
"$$$$###connectionChangedTo state:
\(
state
)
reason:
\(
reason
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
reportRtcStats
stats
:
AgoraChannelStats
)
{
printLog
(
"$$$$###reportRtcStats:
\(
stats
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
lastmileQuality
quality
:
AgoraNetworkQuality
)
{
printLog
(
"$$$$###lastmileQuality:
\(
quality
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
lastmileProbeTest
result
:
AgoraLastmileProbeResult
)
{
printLog
(
"$$$$###lastmileProbeTest:
\(
result
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
didOccur
errorType
:
AgoraEncryptionErrorType
)
{
printLog
(
"$$$$###didOccur errorType:
\(
errorType
)
"
)
}
func
rtcEngine
(
_
engine
:
AgoraRtcEngineKit
,
rtmpStreamingChangedToState
url
:
String
,
state
:
AgoraRtmpStreamingState
,
reason
:
AgoraRtmpStreamingReason
)
{
printLog
(
"$$$$###rtmpStreamingChangedToState:
\(
state
)
url:
\(
url
)
"
)
}
}
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/C/YHVODPlayerViewController.swift
View file @
9bae58cc
...
...
@@ -74,7 +74,10 @@ class YHVODPlayerViewController: YHBasePlayerViewController {
topBarView
.
shareButtonClickEvent
=
{
[
weak
self
]
in
self
?
.
shareLive
()
}
topBarView
.
hideZoomButton
(
playbackInfo
?
.
needHideZoomButton
==
true
)
// 现在改为全部
let
needHideZoom
=
true
//playbackInfo?.needHideZoomButton == true
topBarView
.
hideZoomButton
(
needHideZoom
)
progressControl
.
setPlaying
(
player
?
.
getPlayState
()
==
.
playing
)
}
private
func
setupGestures
()
{
...
...
@@ -170,6 +173,14 @@ class YHVODPlayerViewController: YHBasePlayerViewController {
progressControl
.
giftButtonClickEvent
=
{
[
weak
self
]
in
self
?
.
showGoods
()
}
if
let
player
=
player
{
let
duration
=
player
.
getDuration
()
let
position
=
player
.
getPosition
()
updateProgressControl
(
player
,
position
:
position
)
if
duration
>
0
{
updateProgressMarks
(
with
:
duration
)
}
}
}
private
func
showGoods
()
{
...
...
@@ -276,20 +287,16 @@ extension YHVODPlayerViewController: YHPlayerDelegate {
printLog
(
"####$$$.opening:
\(
player
.
getDuration
()
)
"
)
case
.
openCompleted
:
let
duration
=
player
.
getDuration
()
self
.
updateProgressControl
(
player
,
position
:
duration
)
if
let
recordedVideoSlice
=
self
.
viewModel
.
recordedDetailModel
?
.
recordedVideoSlice
,
recordedVideoSlice
.
count
>
0
{
var
marks
:
[
Double
]
=
[]
recordedVideoSlice
.
forEach
{
item
in
marks
.
append
(
Double
(
item
.
start_second
*
1000
)
/
Double
(
duration
))
}
self
.
progressControl
.
setupMarkers
(
marks
:
marks
)
}
let
position
=
player
.
getPosition
()
self
.
updateProgressControl
(
player
,
position
:
position
)
self
.
updateProgressMarks
(
with
:
duration
)
printLog
(
"####$$$.openCompleted:
\(
player
.
getDuration
()
)
"
)
case
.
playing
:
self
.
progressControl
.
setPlaying
(
true
)
printLog
(
"####$$$.playing:
\(
player
.
getDuration
()
)
"
)
case
.
paused
,
.
stopped
:
printLog
(
"####$$$.paused, .stopped"
)
self
.
progressControl
.
setPlaying
(
false
)
case
.
failed
:
self
.
showAlert
(
message
:
"播放失败,错误原因:
\(
reason
.
rawValue
)
"
)
...
...
@@ -311,6 +318,16 @@ extension YHVODPlayerViewController: YHPlayerDelegate {
//
}
}
private
func
updateProgressMarks
(
with
duration
:
Int
)
{
if
let
recordedVideoSlice
=
self
.
viewModel
.
recordedDetailModel
?
.
recordedVideoSlice
,
recordedVideoSlice
.
count
>
0
{
var
marks
:
[
Double
]
=
[]
recordedVideoSlice
.
forEach
{
item
in
marks
.
append
(
Double
(
item
.
start_second
*
1000
)
/
Double
(
duration
))
}
self
.
progressControl
.
setupMarkers
(
marks
:
marks
)
}
}
private
func
updateProgressControl
(
_
player
:
YHPlayer
,
position
:
Int
)
{
let
duration
=
player
.
getDuration
()
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHPlayerTopBarView.swift
View file @
9bae58cc
...
...
@@ -96,6 +96,23 @@ class YHPlayerTopBarView: UIView {
func
hideZoomButton
(
_
hide
:
Bool
)
{
zoomButton
.
isHidden
=
hide
if
hide
{
shareButton
.
snp
.
remakeConstraints
{
make
in
make
.
centerY
.
equalTo
(
headPortrait
)
make
.
right
.
equalTo
(
closeButton
.
snp
.
left
)
.
offset
(
-
8
)
make
.
width
.
height
.
equalTo
(
buttonWidth
)
make
.
left
.
greaterThanOrEqualTo
(
infoNameLabel
.
snp
.
right
)
.
offset
(
36
)
make
.
left
.
greaterThanOrEqualTo
(
infoCountLabel
.
snp
.
right
)
.
offset
(
36
)
}
}
else
{
shareButton
.
snp
.
remakeConstraints
{
make
in
make
.
centerY
.
equalTo
(
headPortrait
)
make
.
right
.
equalTo
(
zoomButton
.
snp
.
left
)
.
offset
(
-
8
)
make
.
width
.
height
.
equalTo
(
buttonWidth
)
make
.
left
.
greaterThanOrEqualTo
(
infoNameLabel
.
snp
.
right
)
.
offset
(
36
)
make
.
left
.
greaterThanOrEqualTo
(
infoCountLabel
.
snp
.
right
)
.
offset
(
36
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/LivestreamSales(直播销售)/V/YHVideoProgressControl.swift
View file @
9bae58cc
...
...
@@ -254,6 +254,9 @@ class YHVideoProgressControl: UIView {
}
func
setPlaying
(
_
playing
:
Bool
)
{
guard
isPlaying
!=
playing
else
{
return
}
isPlaying
=
playing
playButton
.
isSelected
=
playing
}
...
...
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