File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -123,10 +123,16 @@ class LiveStreamingMain: BaseViewController {
123123
124124 /// make myself a broadcaster
125125 func becomeBroadcaster( ) {
126- agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: AgoraVideoDimension640x360,
127- frameRate: . fps15,
126+ guard let resolution = GlobalSettings . shared. getSetting ( key: " resolution " ) ? . selectedOption ( ) . value as? CGSize ,
127+ let fps = GlobalSettings . shared. getSetting ( key: " fps " ) ? . selectedOption ( ) . value as? AgoraVideoFrameRate ,
128+ let orientation = GlobalSettings . shared. getSetting ( key: " orientation " ) ? . selectedOption ( ) . value as? AgoraVideoOutputOrientationMode else {
129+ LogUtils . log ( message: " invalid video configurations, failed to become broadcaster " , level: . error)
130+ return
131+ }
132+ agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: resolution,
133+ frameRate: fps,
128134 bitrate: AgoraVideoBitrateStandard,
129- orientationMode: . adaptative ) )
135+ orientationMode: orientation ) )
130136
131137 // set up local video to render your local camera preview
132138 let videoCanvas = AgoraRtcVideoCanvas ( )
Original file line number Diff line number Diff line change @@ -69,18 +69,21 @@ class RTMPInjectionMain: BaseViewController {
6969 agoraKit = AgoraRtcEngineKit . sharedEngine ( with: config, delegate: self )
7070 agoraKit. setLogFile ( LogUtils . sdkLogPath ( ) )
7171
72- guard let channelName = configs [ " channelName " ] as? String else { return }
72+ guard let channelName = configs [ " channelName " ] as? String ,
73+ let resolution = GlobalSettings . shared. getSetting ( key: " resolution " ) ? . selectedOption ( ) . value as? CGSize ,
74+ let fps = GlobalSettings . shared. getSetting ( key: " fps " ) ? . selectedOption ( ) . value as? AgoraVideoFrameRate ,
75+ let orientation = GlobalSettings . shared. getSetting ( key: " orientation " ) ? . selectedOption ( ) . value as? AgoraVideoOutputOrientationMode else { return }
7376
7477 // make myself a broadcaster
7578 agoraKit. setChannelProfile ( . liveBroadcasting)
7679 agoraKit. setClientRole ( . broadcaster)
7780
7881 // enable video module and set up video encoding configs
7982 agoraKit. enableVideo ( )
80- agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: AgoraVideoDimension320x240 ,
81- frameRate: . fps15 ,
83+ agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: resolution ,
84+ frameRate: fps ,
8285 bitrate: AgoraVideoBitrateStandard,
83- orientationMode: . adaptative ) )
86+ orientationMode: orientation ) )
8487
8588 // set up local video to render your local camera preview
8689 let videoCanvas = AgoraRtcVideoCanvas ( )
Original file line number Diff line number Diff line change @@ -85,18 +85,21 @@ class RTMPStreamingMain: BaseViewController {
8585 agoraKit = AgoraRtcEngineKit . sharedEngine ( with: config, delegate: self )
8686 agoraKit. setLogFile ( LogUtils . sdkLogPath ( ) )
8787
88- guard let channelName = configs [ " channelName " ] as? String else { return }
88+ guard let channelName = configs [ " channelName " ] as? String ,
89+ let resolution = GlobalSettings . shared. getSetting ( key: " resolution " ) ? . selectedOption ( ) . value as? CGSize ,
90+ let fps = GlobalSettings . shared. getSetting ( key: " fps " ) ? . selectedOption ( ) . value as? AgoraVideoFrameRate ,
91+ let orientation = GlobalSettings . shared. getSetting ( key: " orientation " ) ? . selectedOption ( ) . value as? AgoraVideoOutputOrientationMode else { return }
8992
9093 // make myself a broadcaster
9194 agoraKit. setChannelProfile ( . liveBroadcasting)
9295 agoraKit. setClientRole ( . broadcaster)
9396
9497 // enable video module and set up video encoding configs
9598 agoraKit. enableVideo ( )
96- agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: AgoraVideoDimension320x240 ,
97- frameRate: . fps15 ,
99+ agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: resolution ,
100+ frameRate: fps ,
98101 bitrate: AgoraVideoBitrateStandard,
99- orientationMode: . adaptative ) )
102+ orientationMode: orientation ) )
100103
101104 // set up local video to render your local camera preview
102105 let videoCanvas = AgoraRtcVideoCanvas ( )
Original file line number Diff line number Diff line change @@ -63,7 +63,10 @@ class SuperResolutionMain: BaseViewController {
6363 agoraKit = AgoraRtcEngineKit . sharedEngine ( with: config, delegate: self )
6464
6565 // get channel name from configs
66- guard let channelName = configs [ " channelName " ] as? String else { return }
66+ guard let channelName = configs [ " channelName " ] as? String ,
67+ let resolution = GlobalSettings . shared. getSetting ( key: " resolution " ) ? . selectedOption ( ) . value as? CGSize ,
68+ let fps = GlobalSettings . shared. getSetting ( key: " fps " ) ? . selectedOption ( ) . value as? AgoraVideoFrameRate ,
69+ let orientation = GlobalSettings . shared. getSetting ( key: " orientation " ) ? . selectedOption ( ) . value as? AgoraVideoOutputOrientationMode else { return }
6770
6871
6972 // make myself a broadcaster
@@ -72,10 +75,10 @@ class SuperResolutionMain: BaseViewController {
7275
7376 // enable video module and set up video encoding configs
7477 agoraKit. enableVideo ( )
75- agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: AgoraVideoDimension640x360 ,
76- frameRate: . fps15 ,
78+ agoraKit. setVideoEncoderConfiguration ( AgoraVideoEncoderConfiguration ( size: resolution ,
79+ frameRate: fps ,
7780 bitrate: AgoraVideoBitrateStandard,
78- orientationMode: . adaptative ) )
81+ orientationMode: orientation ) )
7982
8083 // set up local video to render your local camera preview
8184 let videoCanvas = AgoraRtcVideoCanvas ( )
Original file line number Diff line number Diff line change 2525
2626/* Class = "UIButton"; normalTitle = "Join"; ObjectID = "kbN-ZR-nNn"; */
2727"kbN-ZR-nNn.normalTitle" = "加入频道";
28+
29+ "492-pb-Xmc.title" = "设置";
You can’t perform that action at this time.
0 commit comments