Index: talk/examples/objc/AppRTCDemo/ARDAppClient.m |
diff --git a/talk/examples/objc/AppRTCDemo/ARDAppClient.m b/talk/examples/objc/AppRTCDemo/ARDAppClient.m |
index 0f3c423c42cf9100681b2a9eb6faa34187b8258a..ac99ca29971d1b8f3c028786bc5c872fbc6549c2 100644 |
--- a/talk/examples/objc/AppRTCDemo/ARDAppClient.m |
+++ b/talk/examples/objc/AppRTCDemo/ARDAppClient.m |
@@ -42,6 +42,7 @@ |
#import "ARDCEODTURNClient.h" |
#import "ARDJoinResponse.h" |
#import "ARDMessageResponse.h" |
+#import "ARDSDPUtils.h" |
#import "ARDSignalingMessage.h" |
#import "ARDUtilities.h" |
#import "ARDWebSocketChannel.h" |
@@ -344,10 +345,15 @@ static NSInteger const kARDAppClientErrorInvalidRoom = -6; |
[_delegate appClient:self didError:sdpError]; |
return; |
} |
+ // Prefer H264 if available. |
+ RTCSessionDescription *sdpPreferringH264 = |
+ [ARDSDPUtils descriptionForDescription:sdp |
+ preferredVideoCodec:@"H264"]; |
[_peerConnection setLocalDescriptionWithDelegate:self |
- sessionDescription:sdp]; |
+ sessionDescription:sdpPreferringH264]; |
ARDSessionDescriptionMessage *message = |
- [[ARDSessionDescriptionMessage alloc] initWithDescription:sdp]; |
+ [[ARDSessionDescriptionMessage alloc] |
+ initWithDescription:sdpPreferringH264]; |
[self sendSignalingMessage:message]; |
}); |
} |
@@ -441,8 +447,12 @@ static NSInteger const kARDAppClientErrorInvalidRoom = -6; |
ARDSessionDescriptionMessage *sdpMessage = |
(ARDSessionDescriptionMessage *)message; |
RTCSessionDescription *description = sdpMessage.sessionDescription; |
+ // Prefer H264 if available. |
+ RTCSessionDescription *sdpPreferringH264 = |
+ [ARDSDPUtils descriptionForDescription:description |
+ preferredVideoCodec:@"H264"]; |
[_peerConnection setRemoteDescriptionWithDelegate:self |
- sessionDescription:description]; |
+ sessionDescription:sdpPreferringH264]; |
break; |
} |
case kARDSignalingMessageTypeCandidate: { |