@@ -16,11 +16,11 @@ public class StreamInformation {
16
16
public let videoCodec : String
17
17
18
18
init ( json: [ String : Any ] ! ) {
19
- self . streamWidth = json [ " streamWidth " ] as! Int ;
20
- self . streamHeight = json [ " streamHeight " ] as! Int ;
21
- self . videoBitrate = json [ " videoBitrate " ] as! Int ;
22
- self . audioBitrate = json [ " audioBitrate " ] as! Int ;
23
- self . videoCodec = json [ " videoCodec " ] as! String ;
19
+ self . streamWidth = json [ " streamWidth " ] as! Int
20
+ self . streamHeight = json [ " streamHeight " ] as! Int
21
+ self . videoBitrate = json [ " videoBitrate " ] as! Int
22
+ self . audioBitrate = json [ " audioBitrate " ] as! Int
23
+ self . videoCodec = json [ " videoCodec " ] as! String
24
24
}
25
25
}
26
26
public protocol AntMediaClientDelegate : AnyObject {
@@ -55,7 +55,6 @@ public protocol AntMediaClientDelegate: AnyObject {
55
55
*/
56
56
func localStreamStarted( streamId: String )
57
57
58
-
59
58
/**
60
59
Called when playing is started.
61
60
Triggered by server.
@@ -121,7 +120,7 @@ public protocol AntMediaClientDelegate: AnyObject {
121
120
- evenType: The type of the event
122
121
*/
123
122
@available ( * , deprecated, message: " Will be removed soon. Use eventHappened(streamId, eventType, payload) " )
124
- func eventHappened( streamId: String , eventType: String ) ;
123
+ func eventHappened( streamId: String , eventType: String )
125
124
126
125
/**
127
126
It's called when there is an event happen such microphone is muted or unmuted for the specific streamId
@@ -130,17 +129,17 @@ public protocol AntMediaClientDelegate: AnyObject {
130
129
- evenType: The type of the event
131
130
- payload: The payload of the event
132
131
*/
133
- func eventHappened( streamId: String , eventType: String , payload: [ String : Any ] ? )
132
+ func eventHappened( streamId: String , eventType: String , payload: [ String : Any ] ? )
134
133
135
134
/**
136
135
It's called when a new track is added to the stream. It works both on multirack streaming and conferencing
137
136
*/
138
- func trackAdded( track: RTCMediaStreamTrack , stream: [ RTCMediaStream ] )
137
+ func trackAdded( track: RTCMediaStreamTrack , stream: [ RTCMediaStream ] )
139
138
140
139
/**
141
140
It's called when a tack is removed. It works both on multitrack streaming and conferencing
142
141
*/
143
- func trackRemoved( track: RTCMediaStreamTrack )
142
+ func trackRemoved( track: RTCMediaStreamTrack )
144
143
145
144
/**
146
145
It's called when server responses to getBroadcastObject method in AntMediaClient.
@@ -150,28 +149,28 @@ public protocol AntMediaClientDelegate: AnyObject {
150
149
/**
151
150
It's called after`registerStatsListener`is `AntMediaClient` is called
152
151
*/
153
- func onStats( streamId: String , statistics: RTCStatisticsReport ) ;
152
+ func onStats( streamId: String , statistics: RTCStatisticsReport )
154
153
155
154
/**
156
155
It's called after join to the room.
157
156
- streamId: the id of the stream tha can be used to publish stream.
158
157
It's not an obligation to publish a stream. It changes according to the project
159
158
*/
160
- func streamIdToPublish( streamId: String ) ;
159
+ func streamIdToPublish( streamId: String )
161
160
162
161
/**
163
162
Called when new streams join to the room
164
163
- streams: stream id array of the streams that join to the room
165
164
*/
166
165
@available ( * , deprecated, message: " No need to use. New streams are added automatically. trackAdded is called automatically " )
167
- func newStreamsJoined( streams: [ String ] ) ;
166
+ func newStreamsJoined( streams: [ String ] )
168
167
169
168
/**
170
169
Called when some streams leaves from the room. So that players can be removed from the user interface
171
170
- streams: stream id array of the stream that leaves from the room
172
171
*/
173
172
@available ( * , deprecated, message: " No need to use. New streams are removed automatically. trackRemoved is called automatically " )
174
- func streamsLeft( streams: [ String ] ) ;
173
+ func streamsLeft( streams: [ String ] )
175
174
176
175
/**
177
176
The delegate method that sends audio level of the microphone. , audioLeve is between 0 and 1.
@@ -196,14 +195,14 @@ public extension AntMediaClientDelegate {
196
195
}
197
196
198
197
func clientDidDisconnect( _ message: String ) {
199
- AntMediaClient . printf ( " Websocket is disconnected with this problem: \( message) " ) ;
198
+ AntMediaClient . printf ( " Websocket is disconnected with this problem: \( message) " )
200
199
}
201
200
202
- func trackAdded( track: RTCMediaStreamTrack , stream: [ RTCMediaStream ] ) {
201
+ func trackAdded( track: RTCMediaStreamTrack , stream: [ RTCMediaStream ] ) {
203
202
AntMediaClient . printf ( " Track is added with id: \( track. trackId) and kind: \( track. kind) " )
204
203
}
205
204
206
- func trackRemoved( track: RTCMediaStreamTrack ) {
205
+ func trackRemoved( track: RTCMediaStreamTrack ) {
207
206
AntMediaClient . printf ( " Track is removed with id: \( track. trackId) and kind: \( track. kind) " )
208
207
}
209
208
@@ -238,7 +237,7 @@ public extension AntMediaClientDelegate {
238
237
func streamInformation( streamInfo: [ StreamInformation ] ) {
239
238
AntMediaClient . printf ( " Stream information has received " )
240
239
for result in streamInfo {
241
- AntMediaClient . printf ( " resolution width: \( result. streamWidth) heigh: \( result. streamHeight) video " + " bitrate: \( result. videoBitrate) audio bitrate: \( result. audioBitrate) codec: \( result. videoCodec) " ) ;
240
+ AntMediaClient . printf ( " resolution width: \( result. streamWidth) heigh: \( result. streamHeight) video " + " bitrate: \( result. videoBitrate) audio bitrate: \( result. audioBitrate) codec: \( result. videoCodec) " )
242
241
}
243
242
}
244
243
@@ -270,14 +269,13 @@ public extension AntMediaClientDelegate {
270
269
AntMediaClient . printf ( " onLoadBroadcastObject is called for \( streamId) and incoming response: \( message) " )
271
270
}
272
271
273
- func eventHappened( streamId: String , eventType: String , payload: [ String : Any ] ? ) {
272
+ func eventHappened( streamId: String , eventType: String , payload: [ String : Any ] ? ) {
274
273
AntMediaClient . printf ( " \( streamId) \( eventType) with " )
275
274
AntMediaClient . printf ( payload? . json ?? " " )
276
275
}
277
276
278
- func onStats( streamId: String , statistics: RTCStatisticsReport ) {
277
+ func onStats( streamId: String , statistics: RTCStatisticsReport ) {
279
278
AntMediaClient . printf ( " streamId: \( streamId) stats received " )
280
279
}
281
280
282
281
}
283
-
0 commit comments