Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FLUT-38: Texture View implementation #1644

Merged
merged 43 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
e1a46ca
fetching Android SDK from local .m2
ygit Oct 10, 2023
2a2b171
updated implementation
ygit Oct 10, 2023
3b0cc5d
Added texture view implementation
Decoder07 Oct 16, 2023
17d01aa
Added dispose texture view method
Decoder07 Oct 16, 2023
34ea0bd
Merged Develop
Decoder07 Oct 16, 2023
7393f8d
Fixed errors
Decoder07 Oct 16, 2023
9e9718d
Updated pubspec
Decoder07 Oct 16, 2023
f5751ef
Added texture view in sample app
Decoder07 Oct 16, 2023
fa02140
Updated implementation
Decoder07 Oct 18, 2023
0a0d09d
Updated cache extent and add track logic
Decoder07 Oct 19, 2023
834fc2e
Added pooling for prebuilt
Decoder07 Oct 25, 2023
c73266d
released sample app version 1.5.78 (378) 🍀
Decoder07 Oct 26, 2023
342425c
Added active speaker
Decoder07 Oct 27, 2023
16aa782
Updated widget tree in screenshare layout
Decoder07 Oct 30, 2023
de6ccc6
Added event channels in texture-view
Decoder07 Oct 30, 2023
d508514
Updated android sdk branch
Decoder07 Nov 21, 2023
6587f31
Updated versions
Decoder07 Nov 21, 2023
4df3b3c
Updated changelog
Decoder07 Nov 21, 2023
d537fd7
Updated fastlane
Decoder07 Nov 21, 2023
5bde425
released sample app version 1.5.91 (391) 🍀
Decoder07 Nov 21, 2023
96e4538
Fixed resolution issue
Decoder07 Nov 23, 2023
2199554
Updated gemfile
Decoder07 Nov 23, 2023
6b83afa
released sample app version 1.5.92 (392) 🍀
Decoder07 Nov 24, 2023
106df2a
Updated texture view implementation
Decoder07 Nov 24, 2023
6b5775e
Merged develop
Decoder07 Nov 24, 2023
f16fff0
Fixed screenshare bugs
Decoder07 Nov 27, 2023
54b1671
released sample app version 1.5.93 (393) 🍀
Decoder07 Nov 27, 2023
9bfbaf7
released sample app version 1.5.93 (393) 🍀
Decoder07 Nov 27, 2023
c88964f
FLUT-167: Fixed preview stretching bug (#1645)
Decoder07 Nov 28, 2023
3d16436
Fixed colored line issue in grid (#1646)
Decoder07 Nov 29, 2023
9935263
released sample app version 1.5.95 (395) 🍀
Decoder07 Nov 29, 2023
6282b7b
Fixed iOS streal url fix (#1647)
Decoder07 Nov 30, 2023
88aabe6
released sample app version 1.5.96 (396) 🍀
Decoder07 Nov 30, 2023
00cd699
🤖 Automated Format and Fix
ygit Nov 30, 2023
f133c17
Updated android sdk version to 2.8.2
Decoder07 Dec 1, 2023
399adde
🤖 Automated Format and Fix
Decoder07 Dec 1, 2023
55904ff
released sample app version 1.5.97 (397) 🍀
Decoder07 Dec 1, 2023
c599d8a
🤖 Automated Format and Fix
Decoder07 Dec 1, 2023
1a772cb
Fixed iOS crash with texture view (#1649)
Decoder07 Dec 3, 2023
75922ec
released sample app version 1.5.98 (398) 🍀
Decoder07 Dec 4, 2023
13e1de9
🤖 Automated Format and Fix
Decoder07 Dec 4, 2023
4aba3e4
Merge branch 'develop' into FLUT-121
Decoder07 Dec 5, 2023
0e12350
🤖 Automated Format and Fix
Decoder07 Dec 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 32 additions & 41 deletions packages/hms_room_kit/example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a
sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687
url: "https://pub.dev"
source: hosted
version: "1.18.0"
version: "1.17.2"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -226,11 +226,10 @@ packages:
hmssdk_flutter:
dependency: transitive
description:
name: hmssdk_flutter
sha256: "70d00820ab5cb02c03c2d4f41be70dd9dc3406521a469b8989d1e650232efd9a"
url: "https://pub.dev"
source: hosted
version: "1.9.3"
path: "../../hmssdk_flutter"
relative: true
source: path
version: "1.9.4"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -307,10 +306,10 @@ packages:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3"
url: "https://pub.dev"
source: hosted
version: "1.10.0"
version: "1.9.1"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -395,50 +394,42 @@ packages:
dependency: transitive
description:
name: permission_handler
sha256: "860c6b871c94c78e202dc69546d4d8fd84bd59faeb36f8fb9888668a53ff4f78"
sha256: "284a66179cabdf942f838543e10413246f06424d960c92ba95c84439154fcac8"
url: "https://pub.dev"
source: hosted
version: "11.1.0"
version: "11.0.1"
permission_handler_android:
dependency: transitive
description:
name: permission_handler_android
sha256: "2f1bec180ee2f5665c22faada971a8f024761f632e93ddc23310487df52dcfa6"
sha256: f9fddd3b46109bd69ff3f9efa5006d2d309b7aec0f3c1c5637a60a2d5659e76e
url: "https://pub.dev"
source: hosted
version: "12.0.1"
version: "11.1.0"
permission_handler_apple:
dependency: transitive
description:
name: permission_handler_apple
sha256: "1a816084338ada8d574b1cb48390e6e8b19305d5120fe3a37c98825bacc78306"
sha256: "99e220bce3f8877c78e4ace901082fb29fa1b4ebde529ad0932d8d664b34f3f5"
url: "https://pub.dev"
source: hosted
version: "9.2.0"
permission_handler_html:
dependency: transitive
description:
name: permission_handler_html
sha256: d96ff56a757b7f04fa825c469d296c5aebc55f743e87bd639fef91a466a24da8
url: "https://pub.dev"
source: hosted
version: "0.1.0+1"
version: "9.1.4"
permission_handler_platform_interface:
dependency: transitive
description:
name: permission_handler_platform_interface
sha256: d87349312f7eaf6ce0adaf668daf700ac5b06af84338bd8b8574dfbd93ffe1a1
sha256: "6760eb5ef34589224771010805bea6054ad28453906936f843a8cc4d3a55c4a4"
url: "https://pub.dev"
source: hosted
version: "4.0.2"
version: "3.12.0"
permission_handler_windows:
dependency: transitive
description:
name: permission_handler_windows
sha256: "1e8640c1e39121128da6b816d236e714d2cf17fac5a105dd6acdd3403a628004"
sha256: cc074aace208760f1eee6aa4fae766b45d947df85bc831cde77009cdb4720098
url: "https://pub.dev"
source: hosted
version: "0.2.0"
version: "0.1.3"
petitparser:
dependency: transitive
description:
Expand Down Expand Up @@ -539,10 +530,10 @@ packages:
dependency: transitive
description:
name: shared_preferences_web
sha256: "7b15ffb9387ea3e237bb7a66b8a23d2147663d391cafc5c8f37b2e7b4bde5d21"
sha256: d762709c2bbe80626ecc819143013cc820fa49ca5e363620ee20a8b15a3e3daf
url: "https://pub.dev"
source: hosted
version: "2.2.2"
version: "2.2.1"
shared_preferences_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -576,18 +567,18 @@ packages:
dependency: transitive
description:
name: stack_trace
sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b"
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.dev"
source: hosted
version: "1.11.1"
version: "1.11.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
string_scanner:
dependency: transitive
description:
Expand All @@ -608,10 +599,10 @@ packages:
dependency: transitive
description:
name: test_api
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8"
url: "https://pub.dev"
source: hosted
version: "0.6.1"
version: "0.6.0"
tuple:
dependency: transitive
description:
Expand Down Expand Up @@ -680,10 +671,10 @@ packages:
dependency: transitive
description:
name: url_launcher_web
sha256: "138bd45b3a456dcfafc46d1a146787424f8d2edfbf2809c9324361e58f851cf7"
sha256: "7fd2f55fe86cea2897b963e864dc01a7eb0719ecc65fcef4c1cc3d686d718bb2"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "2.2.0"
url_launcher_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -744,10 +735,10 @@ packages:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10
url: "https://pub.dev"
source: hosted
version: "0.3.0"
version: "0.1.4-beta"
win32:
dependency: transitive
description:
Expand All @@ -773,5 +764,5 @@ packages:
source: hosted
version: "6.5.0"
sdks:
dart: ">=3.2.0 <4.0.0"
flutter: ">=3.16.0"
dart: ">=3.1.0 <4.0.0"
flutter: ">=3.13.0"
30 changes: 25 additions & 5 deletions packages/hms_room_kit/lib/src/meeting/meeting_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,12 @@ class MeetingStore extends ChangeNotifier
///Check whether recording is in intialising state
bool isRecordingInInitialisingState = false;

///Pool of video views
List<HMSTextureViewController> viewControllers = [];

///Video View for screenshare
HMSTextureViewController? screenshareViewController;

Future<HMSException?> join(String userName, String roomCode,
{HMSConfig? roomConfig}) async {
//If roomConfig is null then only we call the methods to get the authToken
Expand Down Expand Up @@ -831,7 +837,7 @@ class MeetingStore extends ChangeNotifier
getCurrentAudioDevice();
getAudioDevicesList();
notifyListeners();

setViewControllers();
// if (Platform.isIOS &&
// HMSRoomLayout.roleLayoutData?.screens?.conferencing?.defaultConf !=
// null) {
Expand All @@ -844,6 +850,12 @@ class MeetingStore extends ChangeNotifier
// }
}

void setViewControllers() {
for (var i = 0; i < 6; i++) {
viewControllers.add(HMSTextureViewController(addTrackByDefault: false));
}
}

void setParticipantsList(List<HMSRole> roles) {
String? onStageRoles = HMSRoomLayout.roleLayoutData?.screens?.conferencing
?.defaultConf?.elements?.onStageExp?.onStageRole;
Expand Down Expand Up @@ -993,7 +1005,7 @@ class MeetingStore extends ChangeNotifier

@override
void onHMSError({required HMSException error}) {
log("onHMSError-> error: ${error.code} ${error.message}");
log("onHMSError-> error: ${error.code?.errorCode} ${error.message}");
hmsException = error;
Utilities.showNotification(error.message ?? "", "error");
notifyListeners();
Expand Down Expand Up @@ -1062,8 +1074,7 @@ class MeetingStore extends ChangeNotifier
notifyListeners();
}

//This is to handle the borders around the tiles of peers who are currently speaking
//Reseting the borders of the tile everytime the update is received
//This is to handle the audio level ui on the tiles of peers who are currently speaking
if (activeSpeakerIds.isNotEmpty) {
for (var key in activeSpeakerIds) {
int index = peerTracks.indexWhere((element) => element.uid == key);
Expand All @@ -1074,7 +1085,6 @@ class MeetingStore extends ChangeNotifier
activeSpeakerIds.clear();
}

//Setting the border for peers who are speaking
for (var element in updateSpeakers) {
activeSpeakerIds.add("${element.peer.peerId}mainVideo");
int index = peerTracks
Expand Down Expand Up @@ -1262,6 +1272,13 @@ class MeetingStore extends ChangeNotifier
isRoomEnded = true;
resetForegroundTaskAndOrientation();

for (var element in viewControllers) {
element.disposeTextureView();
}
screenshareViewController?.disposeTextureView();
viewControllers.clear();
screenshareViewController = null;

///Here we call the method passed by the user in HMSPrebuilt as a callback
if (Constant.onLeave != null) {
Constant.onLeave!();
Expand Down Expand Up @@ -1592,6 +1609,9 @@ class MeetingStore extends ChangeNotifier
int peerIndex = peerTracks.indexWhere(
(element) => element.uid == peer.peerId + track.trackId);
if (peerIndex != -1) {
if ((screenShareCount - 1) == currentScreenSharePage) {
currentScreenSharePage--;
}
screenShareCount--;
peerTracks.removeAt(peerIndex);
notifyListeners();
Expand Down
5 changes: 2 additions & 3 deletions packages/hms_room_kit/lib/src/model/peer_track_node.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,25 @@ class PeerTrackNode extends ChangeNotifier {
String uid;
HMSVideoTrack? track;
HMSAudioTrack? audioTrack;
bool isOffscreen;
int? networkQuality;
RTCStats? stats;
int audioLevel;
bool pinTile;
bool isOffscreen = true;

PeerTrackNode(
{required this.peer,
this.track,
this.audioTrack,
required this.uid,
this.isOffscreen = true,
this.networkQuality = -1,
this.stats,
this.audioLevel = -1,
this.pinTile = false});

@override
String toString() {
return 'PeerTrackNode{peerId: ${peer.peerId}, name: ${peer.name}, track: $track}, isVideoOn: $isOffscreen }';
return 'PeerTrackNode{peerId: ${peer.peerId}, name: ${peer.name}, track: $track} }';
}

void notify() {
Expand Down
2 changes: 1 addition & 1 deletion packages/hms_room_kit/lib/src/preview/preview_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ class _PreviewPageState extends State<PreviewPage> {
///Otherwise it will render the circular avatar
child: (previewStore.isVideoOn)
? Center(
child: HMSVideoView(
child: HMSTextureView(
scaleType: ScaleType
.SCALE_ASPECT_FILL,
track: previewStore
Expand Down
Loading