Skip to content

Commit

Permalink
update.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudwebrtc committed Jul 21, 2024
1 parent 23ab655 commit 0d6ecb3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions example/lib/pages/prejoin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ class _PreJoinPageState extends State<PreJoinPage> {
color: Colors.black54,
child: _videoTrack != null
? VideoTrackRenderer(
renderMode: VideoRenderMode.auto,
_videoTrack!,
fit: RTCVideoViewObjectFit
.RTCVideoViewObjectFitContain,
Expand Down
1 change: 1 addition & 0 deletions example/lib/widgets/participant.dart
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ abstract class _ParticipantWidgetState<T extends ParticipantWidget>
onTap: () => setState(() => _visible = !_visible),
child: activeVideoTrack != null && !activeVideoTrack!.muted
? VideoTrackRenderer(
renderMode: VideoRenderMode.auto,
activeVideoTrack!,
fit: RTCVideoViewObjectFit.RTCVideoViewObjectFitContain,
)
Expand Down
7 changes: 5 additions & 2 deletions lib/src/widgets/video_track_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ class _VideoTrackRendererState extends State<VideoTrackRenderer> {
future: _initializeRenderer(),
builder: (context, snapshot) {
if ((snapshot.hasData && _renderer != null) ||
widget.renderMode == VideoRenderMode.platformView) {
[VideoRenderMode.auto, VideoRenderMode.platformView]
.contains(widget.renderMode)) {
return Builder(
key: _internalKey,
builder: (ctx) {
Expand All @@ -172,13 +173,15 @@ class _VideoTrackRendererState extends State<VideoTrackRenderer> {
widget.track.onVideoViewBuild?.call(_internalKey);
});
if (lkPlatformIs(PlatformType.iOS) &&
widget.renderMode == VideoRenderMode.platformView) {
[VideoRenderMode.auto, VideoRenderMode.platformView]
.contains(widget.renderMode)) {
return rtc.RTCVideoPlatFormView(
mirror: _shouldMirror(),
objectFit: widget.fit,
onViewReady: (controller) {
_renderer = controller;
_renderer?.srcObject = widget.track.mediaStream;
_attach();
},
);
}
Expand Down
5 changes: 4 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ dependencies:
uuid: '>=3.0.6'
synchronized: ^3.0.0+3
protobuf: ^3.0.0
flutter_webrtc: ^0.11.3
flutter_webrtc:
git:
url: https://github.com/flutter-webrtc/flutter-webrtc.git
ref: feat/platform-view-using-av-samplebuffer
device_info_plus: '>=8.0.0'
js: '>=0.6.4'
platform_detect: ^2.0.7
Expand Down

0 comments on commit 0d6ecb3

Please sign in to comment.