From e1a46ca4416ff8fa78f397379eeed3fbb46105d5 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Tue, 10 Oct 2023 12:06:07 +0530 Subject: [PATCH 01/53] fetching Android SDK from local .m2 --- packages/hmssdk_flutter/android/build.gradle | 11 ++++++++--- packages/hmssdk_flutter/lib/assets/sdk-versions.json | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 2ac0b37ec..3f3d7b81b 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -20,6 +20,7 @@ buildscript { rootProject.allprojects { repositories { + mavenlocal() google() mavenCentral() maven { url 'https://jitpack.io' } @@ -41,9 +42,13 @@ android { } dependencies { - implementation "live.100ms:android-sdk:${sdkVersions['android']}" - implementation "live.100ms:video-view:${sdkVersions['android']}" - implementation "live.100ms:hls-player:${sdkVersions['android']}" +// implementation "live.100ms:android-sdk:${sdkVersions['android']}" +// implementation "live.100ms:video-view:${sdkVersions['android']}" +// implementation "live.100ms:hls-player:${sdkVersions['android']}" + implementation "live.100ms:android-sdk:2.7.8" + implementation "live.100ms:video-view:2.7.8" + implementation "live.100ms:hls-player:2.7.8" + implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/lib/assets/sdk-versions.json b/packages/hmssdk_flutter/lib/assets/sdk-versions.json index e320262f7..f3733c68a 100644 --- a/packages/hmssdk_flutter/lib/assets/sdk-versions.json +++ b/packages/hmssdk_flutter/lib/assets/sdk-versions.json @@ -3,5 +3,5 @@ "ios": "1.0.1", "iOSBroadcastExtension": "0.0.9", "iOSHLSPlayerSDK": "0.0.2", - "android": "2.7.7" + "android": "2.7.8" } From 2a2b1714b67f5dd32a9353bad7e63132f22ad383 Mon Sep 17 00:00:00 2001 From: Yogesh Singh Date: Tue, 10 Oct 2023 12:06:18 +0530 Subject: [PATCH 02/53] updated implementation --- .../views/HMSVideoViewFactory.kt | 18 ++++++------- .../lib/src/ui/meeting/hms_video_view.dart | 27 ++++++++++--------- 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt index cf903c056..eb3032cb5 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt @@ -24,9 +24,9 @@ class HMSVideoViewWidget( private var hmsVideoView: HMSVideoView? = null init { - if (hmsVideoView == null) { - hmsVideoView = HMSVideoView(context, setMirror, scaleType, track, disableAutoSimulcastLayerSelect, hmssdkFlutterPlugin) - } +// if (hmsVideoView == null) { +// hmsVideoView = HMSVideoView(context, setMirror, scaleType, track, disableAutoSimulcastLayerSelect, hmssdkFlutterPlugin) +// } } override fun getView(): View? { @@ -34,12 +34,12 @@ class HMSVideoViewWidget( } override fun dispose() { - if (hmsVideoView != null) { - hmsVideoView?.onDisposeCalled() - } else { - Log.e("HMSVideoView error", "onDisposeCalled error hmsVideoView is null") - } - hmsVideoView = null +// if (hmsVideoView != null) { +// hmsVideoView?.onDisposeCalled() +// } else { +// Log.e("HMSVideoView error", "onDisposeCalled error hmsVideoView is null") +// } +// hmsVideoView = null } } diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index db292f6dd..a548c3717 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -125,19 +125,20 @@ class _PlatformView extends StatelessWidget { Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return AndroidView( - viewType: 'HMSVideoView', - onPlatformViewCreated: onPlatformViewCreated, - creationParamsCodec: StandardMessageCodec(), - creationParams: { - 'track_id': track.trackId, - 'set_mirror': track.source != "REGULAR" ? false : setMirror, - 'scale_type': scaleType.value, - 'match_parent': matchParent, - 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect - }, - gestureRecognizers: {}, - ); + return Texture(textureId: textureId); // get textureId fom video view + // return AndroidView( + // viewType: 'HMSVideoView', + // onPlatformViewCreated: onPlatformViewCreated, + // creationParamsCodec: StandardMessageCodec(), + // creationParams: { + // 'track_id': track.trackId, + // 'set_mirror': track.source != "REGULAR" ? false : setMirror, + // 'scale_type': scaleType.value, + // 'match_parent': matchParent, + // 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect + // }, + // gestureRecognizers: {}, + // ); } else if (Platform.isIOS) { ///UIKitView for ios it uses VideoView provided by 100ms ios_sdk internally. return UiKitView( From 3b0cc5d2baa72192c6de77122286bf5dbbe517cd Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 16 Oct 2023 11:59:39 +0530 Subject: [PATCH 03/53] Added texture view implementation --- packages/hmssdk_flutter/android/build.gradle | 9 +-- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 66 +++++++++++++++++++ .../hmssdk_flutter/views/HMSTextureView.kt | 39 +++++++++++ .../lib/src/common/platform_methods.dart | 12 +++- .../lib/src/ui/meeting/hms_video_view.dart | 55 +++++++++++++--- 5 files changed, 168 insertions(+), 13 deletions(-) create mode 100644 packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 3f3d7b81b..00e7d836d 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -20,7 +20,7 @@ buildscript { rootProject.allprojects { repositories { - mavenlocal() +// mavenlocal() google() mavenCentral() maven { url 'https://jitpack.io' } @@ -45,10 +45,11 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "live.100ms:android-sdk:2.7.8" - implementation "live.100ms:video-view:2.7.8" - implementation "live.100ms:hls-player:2.7.8" + implementation "com.github.100mslive.android-sdk:videoview:feature~custom-texture-imp-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:feature~custom-texture-imp-SNAPSHOT" + implementation 'com.github.100mslive.android-sdk:lib:feature~custom-texture-imp-SNAPSHOT' +// implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index e468bfed2..0cfde683c 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -14,11 +14,14 @@ import com.google.gson.JsonElement import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.activity.ActivityAware import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding +import io.flutter.plugin.common.BinaryMessenger import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.MethodCall import io.flutter.plugin.common.MethodChannel import io.flutter.plugin.common.MethodChannel.MethodCallHandler import io.flutter.plugin.common.MethodChannel.Result +import io.flutter.view.TextureRegistry +import io.flutter.view.TextureRegistry.SurfaceTextureEntry import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch @@ -26,6 +29,7 @@ import live.hms.hmssdk_flutter.Constants.Companion.METHOD_CALL import live.hms.hmssdk_flutter.hls_player.HMSHLSPlayerAction import live.hms.hmssdk_flutter.methods.* import live.hms.hmssdk_flutter.views.HMSHLSPlayerFactory +import live.hms.hmssdk_flutter.views.HMSTextureView import live.hms.hmssdk_flutter.views.HMSVideoViewFactory import live.hms.video.audio.HMSAudioManager.* import live.hms.video.connection.stats.* @@ -77,6 +81,9 @@ class HmssdkFlutterPlugin : private var hmsKeyChangeObserverList = ArrayList() var hlsStreamUrl: String? = null + val renderers = HashMap() + var hmsTextureRegistry: TextureRegistry? = null + var hmsBinaryMessenger: BinaryMessenger? = null override fun onAttachedToEngine( @NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding, ) { @@ -118,12 +125,17 @@ class HmssdkFlutterPlugin : "HMSHLSPlayer", hmsHLSPlayerFactory, ) + + hmsTextureRegistry = flutterPluginBinding.textureRegistry + hmsBinaryMessenger = flutterPluginBinding.binaryMessenger + hmssdkFlutterPlugin = this } else { Log.e("Plugin Warning", "hmssdkFlutterPlugin already exists in onAttachedToEngine") } } + override fun onMethodCall( @NonNull call: MethodCall, @NonNull result: Result, @@ -241,6 +253,12 @@ class HmssdkFlutterPlugin : "get_room_layout" -> { getRoomLayout(call, result) } + "create_texture_view" -> { + createTextureView(call,result) + } + "dispose_texture_view" -> { + disposeTextureView(call,result) + } else -> { result.notImplemented() } @@ -576,6 +594,54 @@ class HmssdkFlutterPlugin : return null } + private fun createTextureView(call: MethodCall, result: Result){ + + val trackId = call.argument("track_id") + trackId?.let { + val room = hmssdk?.getRoom() + + room?.let { currentRoom -> + val track = HmsUtilities.getVideoTrack(it,currentRoom) + track?.let { videoTrack -> + val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() + entry?.let { surfaceTextureEntry -> + val surfaceTexture = surfaceTextureEntry.surfaceTexture() + val renderer = HMSTextureView(surfaceTexture,videoTrack) + renderers["${entry.id()}$trackId"] = renderer + val eventChannel = EventChannel( + hmsBinaryMessenger, + "HMSTextureView/Texture" + entry.id() + ) + + eventChannel.setStreamHandler(renderer) + renderer.setTextureViewEventChannel(eventChannel) + + val data = HashMap() + + data["texture_id"] = surfaceTextureEntry.id() + result.success(HMSResultExtension.toDictionary(true,data)) + return + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","SurfaceTextureEntry is null","NULL ERROR",result) + } + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","No track with $trackId found","Track not found error",result) + } + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","room is null","NULL ERROR",result) + } + } ?: run { + HMSErrorLogger.returnHMSException( + "createTextureView", + "trackId is null", + "NULL ERROR", + result + ) + } + } + + + private fun getAllTracks(): ArrayList { val room = hmssdk!!.getRoom() val allTracks = ArrayList() diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt new file mode 100644 index 000000000..dde232a2b --- /dev/null +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -0,0 +1,39 @@ +package live.hms.hmssdk_flutter.views + +import android.graphics.SurfaceTexture +import io.flutter.plugin.common.EventChannel +import io.flutter.plugin.common.EventChannel.EventSink +import live.hms.video.media.tracks.HMSVideoTrack +import live.hms.videoview.textureview.HMSTextureRenderer + +class HMSTextureView( + texture: SurfaceTexture, + track: HMSVideoTrack +): EventChannel.StreamHandler{ + + var eventChannel: EventChannel? = null + var eventSink: EventSink? = null + var hmsTextureRenderer: HMSTextureRenderer? = null + + init { + hmsTextureRenderer = HMSTextureRenderer(texture) + hmsTextureRenderer?.addTrack(track) + } + + fun disposeTextureView(){ + hmsTextureRenderer?.removeTrack() + hmsTextureRenderer = null + } + + fun setTextureViewEventChannel(eventChannel:EventChannel){ + this.eventChannel = eventChannel + } + + override fun onListen(arguments: Any?, events: EventSink?) { + eventSink = events + } + + override fun onCancel(arguments: Any?) { + eventSink = null + } +} \ No newline at end of file diff --git a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart index d6b775a2d..62919fd8c 100644 --- a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart +++ b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart @@ -190,7 +190,9 @@ enum PlatformMethod { cancelPreview, lowerLocalPeerHand, lowerRemotePeerHand, - raiseLocalPeerHand + raiseLocalPeerHand, + createTextureView, + disposeTextureView } extension PlatformMethodValues on PlatformMethod { @@ -474,6 +476,10 @@ extension PlatformMethodValues on PlatformMethod { return "lower_remote_peer_hand"; case PlatformMethod.raiseLocalPeerHand: return "raise_local_peer_hand"; + case PlatformMethod.createTextureView: + return "create_texture_view"; + case PlatformMethod.disposeTextureView: + return "dispose_texture_view"; default: return 'unknown'; } @@ -759,6 +765,10 @@ extension PlatformMethodValues on PlatformMethod { return PlatformMethod.lowerRemotePeerHand; case "raise_local_peer_hand": return PlatformMethod.raiseLocalPeerHand; + case "create_texture_view": + return PlatformMethod.createTextureView; + case "dispose_texture_view": + return PlatformMethod.disposeTextureView; default: return PlatformMethod.unknown; } diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index a548c3717..24a93101f 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -7,6 +7,7 @@ import 'package:flutter/services.dart' show StandardMessageCodec; // Project imports: import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +import 'package:hmssdk_flutter/src/service/platform_service.dart'; ///100ms HMSVideoView /// @@ -102,9 +103,8 @@ class HMSVideoView extends StatelessWidget { } } -class _PlatformView extends StatelessWidget { +class _PlatformView extends StatefulWidget { final HMSTrack track; - final bool setMirror; final bool matchParent; final ScaleType scaleType; @@ -119,13 +119,50 @@ class _PlatformView extends StatelessWidget { this.disableAutoSimulcastLayerSelect = false}) : super(key: key); + @override + State<_PlatformView> createState() => _PlatformViewState(); +} + +class _PlatformViewState extends State<_PlatformView> { + + int? textureId; + void onPlatformViewCreated(int id) {} + @override + void initState() { + super.initState(); + getTextureId(); + } + + @override + void dispose() { + disposeTextureView(); + super.dispose(); + } + + void getTextureId() async{ + var result = await PlatformService.invokeMethod(PlatformMethod.createTextureView, + arguments: {"track_id": widget.track.trackId}); + if (result["success"]) { + setState(() { + textureId = result["data"]["texture_id"]; + }); + } + } + + void disposeTextureView() async{ + + } + @override Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return Texture(textureId: textureId); // get textureId fom video view + return + textureId == null ? Container() : Texture(textureId: textureId!); + + // /Texture(textureId: textureId); // get textureId fom video view // return AndroidView( // viewType: 'HMSVideoView', // onPlatformViewCreated: onPlatformViewCreated, @@ -146,11 +183,13 @@ class _PlatformView extends StatelessWidget { onPlatformViewCreated: onPlatformViewCreated, creationParamsCodec: StandardMessageCodec(), creationParams: { - 'track_id': track.trackId, - 'set_mirror': track.source != "REGULAR" ? false : setMirror, - 'scale_type': scaleType.value, - 'match_parent': matchParent, - 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect + 'track_id': widget.track.trackId, + 'set_mirror': + widget.track.source != "REGULAR" ? false : widget.setMirror, + 'scale_type': widget.scaleType.value, + 'match_parent': widget.matchParent, + 'disable_auto_simulcast_layer_select': + widget.disableAutoSimulcastLayerSelect }, gestureRecognizers: {}, ); From 17d01aaeb4ad49fd05ec131a2ee421cfe7cd94f1 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 16 Oct 2023 16:36:55 +0530 Subject: [PATCH 04/53] Added dispose texture view method --- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 39 ++++++++++++++----- .../hmssdk_flutter/views/HMSTextureView.kt | 37 ++++++++++-------- .../lib/src/ui/meeting/hms_video_view.dart | 10 ++++- 3 files changed, 59 insertions(+), 27 deletions(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 0cfde683c..0005e072d 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -606,16 +606,16 @@ class HmssdkFlutterPlugin : val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() entry?.let { surfaceTextureEntry -> val surfaceTexture = surfaceTextureEntry.surfaceTexture() - val renderer = HMSTextureView(surfaceTexture,videoTrack) + val renderer = HMSTextureView(surfaceTexture,videoTrack,entry) renderers["${entry.id()}$trackId"] = renderer - val eventChannel = EventChannel( - hmsBinaryMessenger, - "HMSTextureView/Texture" + entry.id() - ) - - eventChannel.setStreamHandler(renderer) - renderer.setTextureViewEventChannel(eventChannel) - +// val eventChannel = EventChannel( +// hmsBinaryMessenger, +// "HMSTextureView/Texture" + entry.id() +// ) + +// eventChannel.setStreamHandler(renderer) +// renderer.setTextureViewEventChannel(eventChannel) + Log.i("HMSTextureView","createTextureView renderer size is ${renderers.size}") val data = HashMap() data["texture_id"] = surfaceTextureEntry.id() @@ -640,7 +640,28 @@ class HmssdkFlutterPlugin : } } + private fun disposeTextureView(call: MethodCall,result: Result){ + val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") + val textureId = call.argument("texture_id") ?: HMSErrorLogger.returnArgumentsError("textureId is null") + var renderer = renderers["$textureId$trackId"] + + if(renderer != null){ + renderer.disposeTextureView() + Log.i("HMSTextureView","disposeTextureView renderer size is ${renderers.size}") + renderer = null + renderers.remove("$textureId$trackId") + result.success(HMSResultExtension.toDictionary(true,null)) + } + else { + HMSErrorLogger.returnHMSException( + "disposeTextureView", + "No textureView with given textureId found", + "Key not found error", + result + ) + } + } private fun getAllTracks(): ArrayList { val room = hmssdk!!.getRoom() diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index dde232a2b..866aa8cf0 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -1,39 +1,44 @@ package live.hms.hmssdk_flutter.views import android.graphics.SurfaceTexture +import android.util.Log import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.EventChannel.EventSink +import io.flutter.view.TextureRegistry import live.hms.video.media.tracks.HMSVideoTrack import live.hms.videoview.textureview.HMSTextureRenderer class HMSTextureView( texture: SurfaceTexture, - track: HMSVideoTrack -): EventChannel.StreamHandler{ + track: HMSVideoTrack, + var entry: TextureRegistry.SurfaceTextureEntry? +){ - var eventChannel: EventChannel? = null - var eventSink: EventSink? = null +// var eventChannel: EventChannel? = null +// var eventSink: EventSink? = null var hmsTextureRenderer: HMSTextureRenderer? = null - init { hmsTextureRenderer = HMSTextureRenderer(texture) hmsTextureRenderer?.addTrack(track) } fun disposeTextureView(){ + Log.i("HMSTextureView","Inside disposeTextureView $entry $hmsTextureRenderer") hmsTextureRenderer?.removeTrack() + entry?.release() + entry = null hmsTextureRenderer = null } - fun setTextureViewEventChannel(eventChannel:EventChannel){ - this.eventChannel = eventChannel - } - - override fun onListen(arguments: Any?, events: EventSink?) { - eventSink = events - } - - override fun onCancel(arguments: Any?) { - eventSink = null - } +// fun setTextureViewEventChannel(eventChannel:EventChannel){ +// this.eventChannel = eventChannel +// } +// +// override fun onListen(arguments: Any?, events: EventSink?) { +// eventSink = events +// } +// +// override fun onCancel(arguments: Any?) { +// eventSink = null +// } } \ No newline at end of file diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index 24a93101f..f24f9f33c 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -144,7 +144,7 @@ class _PlatformViewState extends State<_PlatformView> { void getTextureId() async{ var result = await PlatformService.invokeMethod(PlatformMethod.createTextureView, arguments: {"track_id": widget.track.trackId}); - if (result["success"]) { + if (result["success"] && mounted) { setState(() { textureId = result["data"]["texture_id"]; }); @@ -152,7 +152,13 @@ class _PlatformViewState extends State<_PlatformView> { } void disposeTextureView() async{ - + var result = await PlatformService.invokeMethod(PlatformMethod.disposeTextureView, + arguments: {"track_id": widget.track.trackId,"texture_id":textureId.toString()}); + if (result["success"] && mounted) { + setState(() { + textureId = null; + }); + } } @override From 7393f8d794d110c621051728a0783f966559bbce Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 16 Oct 2023 16:40:23 +0530 Subject: [PATCH 05/53] Fixed errors --- .../kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 2b81da7ea..c5e6f9c0d 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -258,11 +258,13 @@ class HmssdkFlutterPlugin : createTextureView(call,result) } "dispose_texture_view" -> { - disposeTextureView(call,result) + disposeTextureView(call, result) + } "get_peer_list_iterator", "peer_list_iterator_has_next", "peer_list_iterator_next" -> { HMSPeerListIteratorAction.peerListIteratorAction(call, result, hmssdk!!) } + else -> { result.notImplemented() } From 9e9718d572b41b2a5e95677e50c94794360f7897 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 16 Oct 2023 16:49:17 +0530 Subject: [PATCH 06/53] Updated pubspec --- packages/hmssdk_flutter/example/pubspec.lock | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 3274e9089..17dfcf534 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -298,9 +298,10 @@ packages: hmssdk_flutter: dependency: transitive description: - path: ".." - relative: true - source: path + name: hmssdk_flutter + sha256: e8b12fbdde193bc0bfbf0ef40086840c0b8d056778f01c53f4efa15849f35e38 + url: "https://pub.dev" + source: hosted version: "1.9.0" http: dependency: transitive From f5751efe7c1dc14e8fb1039c9071e514ae6522cd Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 16 Oct 2023 19:15:14 +0530 Subject: [PATCH 07/53] Added texture view in sample app --- .../lib/src/meeting/meeting_store.dart | 116 ++-- .../lib/src/model/peer_track_node.dart | 42 +- .../src/widgets/common_widgets/peer_tile.dart | 547 +++++++++--------- .../widgets/common_widgets/video_view.dart | 7 +- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 10 +- .../hmssdk_flutter/views/HMSTextureView.kt | 8 +- .../lib/src/ui/meeting/hms_video_view.dart | 24 +- 7 files changed, 377 insertions(+), 377 deletions(-) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 151fc3255..4e0e9f241 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1045,68 +1045,68 @@ class MeetingStore extends ChangeNotifier @override void onUpdateSpeakers({required List updateSpeakers}) { - //To handle the active speaker mode scenario - if ((currentPage == 0) && - (meetingMode == MeetingMode.activeSpeakerWithInset || - meetingMode == MeetingMode.activeSpeakerWithoutInset) && - peerTracks.length > 6) { - /* Here we iterate through the updateSpeakers list - * and do the following: - * Find the index of the peer - * If the peer is out of the screen when you are on first page - * we remove the peer from that index and insert it on the first index - */ - for (var speaker in updateSpeakers) { - int index = peerTracks.indexWhere((previousSpeaker) => - previousSpeaker.uid == "${speaker.peer.peerId}mainVideo"); - if (index > 5) { - PeerTrackNode activeSpeaker = peerTracks[index]; - peerTracks.removeAt(index); - peerTracks.insert(screenShareCount, activeSpeaker); - peerTracks[screenShareCount].setOffScreenStatus(false); - } - } - 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 - if (activeSpeakerIds.isNotEmpty) { - for (var key in activeSpeakerIds) { - int index = peerTracks.indexWhere((element) => element.uid == key); - if (index != -1) { - peerTracks[index].setAudioLevel(-1); - } - } - activeSpeakerIds.clear(); - } - - //Setting the border for peers who are speaking - for (var element in updateSpeakers) { - activeSpeakerIds.add("${element.peer.peerId}mainVideo"); - int index = peerTracks - .indexWhere((element) => element.uid == activeSpeakerIds.last); - if (index != -1) { - peerTracks[index].setAudioLevel(element.audioLevel); - } - } + // //To handle the active speaker mode scenario + // if ((currentPage == 0) && + // (meetingMode == MeetingMode.activeSpeakerWithInset || + // meetingMode == MeetingMode.activeSpeakerWithoutInset) && + // peerTracks.length > 6) { + // /* Here we iterate through the updateSpeakers list + // * and do the following: + // * Find the index of the peer + // * If the peer is out of the screen when you are on first page + // * we remove the peer from that index and insert it on the first index + // */ + // for (var speaker in updateSpeakers) { + // int index = peerTracks.indexWhere((previousSpeaker) => + // previousSpeaker.uid == "${speaker.peer.peerId}mainVideo"); + // if (index > 5) { + // PeerTrackNode activeSpeaker = peerTracks[index]; + // peerTracks.removeAt(index); + // peerTracks.insert(screenShareCount, activeSpeaker); + // peerTracks[screenShareCount].setOffScreenStatus(false); + // } + // } + // notifyListeners(); + // } - // Below code for change track and text in PIP mode iOS and android. - // if (updateSpeakers.isNotEmpty) { - // if (Platform.isIOS && (screenShareCount == 0 || isScreenShareOn)) { - // if (updateSpeakers[0].peer.videoTrack != null) { - // changePIPWindowTrackOnIOS( - // track: updateSpeakers[0].peer.videoTrack, - // alternativeText: updateSpeakers[0].peer.name, - // ratio: [9, 16]); - // } else { - // changePIPWindowTextOnIOS( - // text: updateSpeakers[0].peer.name, ratio: [9, 16]); + // //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 + // if (activeSpeakerIds.isNotEmpty) { + // for (var key in activeSpeakerIds) { + // int index = peerTracks.indexWhere((element) => element.uid == key); + // if (index != -1) { + // peerTracks[index].setAudioLevel(-1); // } - // } else if (Platform.isAndroid) { - // changePIPWindowOnAndroid("${updateSpeakers[0].peer.peerId}mainVideo"); // } + // activeSpeakerIds.clear(); // } + + // //Setting the border for peers who are speaking + // for (var element in updateSpeakers) { + // activeSpeakerIds.add("${element.peer.peerId}mainVideo"); + // int index = peerTracks + // .indexWhere((element) => element.uid == activeSpeakerIds.last); + // if (index != -1) { + // peerTracks[index].setAudioLevel(element.audioLevel); + // } + // } + + // // Below code for change track and text in PIP mode iOS and android. + // // if (updateSpeakers.isNotEmpty) { + // // if (Platform.isIOS && (screenShareCount == 0 || isScreenShareOn)) { + // // if (updateSpeakers[0].peer.videoTrack != null) { + // // changePIPWindowTrackOnIOS( + // // track: updateSpeakers[0].peer.videoTrack, + // // alternativeText: updateSpeakers[0].peer.name, + // // ratio: [9, 16]); + // // } else { + // // changePIPWindowTextOnIOS( + // // text: updateSpeakers[0].peer.name, ratio: [9, 16]); + // // } + // // } else if (Platform.isAndroid) { + // // changePIPWindowOnAndroid("${updateSpeakers[0].peer.peerId}mainVideo"); + // // } + // // } } @override diff --git a/packages/hms_room_kit/lib/src/model/peer_track_node.dart b/packages/hms_room_kit/lib/src/model/peer_track_node.dart index afbfee2e3..0314139a1 100644 --- a/packages/hms_room_kit/lib/src/model/peer_track_node.dart +++ b/packages/hms_room_kit/lib/src/model/peer_track_node.dart @@ -10,7 +10,6 @@ class PeerTrackNode extends ChangeNotifier { String uid; HMSVideoTrack? track; HMSAudioTrack? audioTrack; - bool isOffscreen; int? networkQuality; RTCStats? stats; int audioLevel; @@ -21,7 +20,6 @@ class PeerTrackNode extends ChangeNotifier { this.track, this.audioTrack, required this.uid, - this.isOffscreen = true, this.networkQuality = -1, this.stats, this.audioLevel = -1, @@ -29,7 +27,7 @@ class PeerTrackNode extends ChangeNotifier { @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() { @@ -37,51 +35,51 @@ class PeerTrackNode extends ChangeNotifier { } void setOffScreenStatus(bool currentState) { - isOffscreen = currentState; + // isOffscreen = currentState; notify(); } void setAudioLevel(int audioLevel) { this.audioLevel = audioLevel; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } void setNetworkQuality(int? networkQuality) { if (networkQuality != null) { this.networkQuality = networkQuality; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } } void setHMSRemoteAudioStats(HMSRemoteAudioStats hmsRemoteAudioStats) { stats?.hmsRemoteAudioStats = hmsRemoteAudioStats; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } void setHMSRemoteVideoStats(HMSRemoteVideoStats hmsRemoteVideoStats) { stats?.hmsRemoteVideoStats = hmsRemoteVideoStats; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } void setHMSLocalVideoStats(List hmsLocalVideoStats) { stats?.hmsLocalVideoStats = hmsLocalVideoStats; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } void setHMSLocalAudioStats(HMSLocalAudioStats hmsLocalAudioStats) { stats?.hmsLocalAudioStats = hmsLocalAudioStats; - if (!isOffscreen) { - notify(); - } + // if (!isOffscreen) { + // notify(); + // } } } diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index 9c50c366a..1b942b765 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -55,315 +55,298 @@ class _PeerTileState extends State { Widget build(BuildContext context) { return Semantics( label: "fl_${context.read().peer.name}_video_tile", - child: FocusDetector( - onFocusLost: () { - if (mounted) { - Provider.of(context, listen: false) - .setOffScreenStatus(true); - } - }, - onFocusGained: () { - Provider.of(context, listen: false) - .setOffScreenStatus(false); - }, - key: Key(context.read().uid), - //Here we check whether the video track is a regular - //video track or a screen share track - //We check this by checking the uid of the track - //If it contains `mainVideo` then it is a regular video track - //else it is a screen share track - child: LayoutBuilder(builder: (context, BoxConstraints constraints) { - return context.read().uid.contains("mainVideo") - ? Container( - key: key, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HMSThemeColors.backgroundDefault, - ), - child: Semantics( - label: - "fl_${context.read().peer.name}_video_on", - child: Stack( - children: [ - VideoView( - uid: context.read().uid, - scaleType: widget.scaleType, - avatarTitleFontSize: widget.avatarTitleFontSize, - avatarRadius: widget.avatarRadius, - avatarTitleTextLineHeight: - widget.avatarTitleTextLineHeight, - ), - Semantics( - label: - "fl_${context.read().peer.name}_degraded_tile", - child: const DegradeTile(), - ), - NameAndNetwork(maxWidth: constraints.maxWidth), - const HandRaise(), //top left - const BRBTag(), //top left - const AudioMuteStatus(), //top right - context.read().peer.isLocal - ? const LocalPeerMoreOption( - isInsetTile: false, - ) - : const MoreOption(), //bottom right - Semantics( - label: "fl_stats_on_tile", - child: RTCStatsView( - isLocal: - context.read().peer.isLocal), - ) - ], + child: LayoutBuilder(builder: (context, BoxConstraints constraints) { + return context.read().uid.contains("mainVideo") + ? Container( + key: key, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HMSThemeColors.backgroundDefault, + ), + child: Semantics( + label: + "fl_${context.read().peer.name}_video_on", + child: Stack( + children: [ + VideoView( + uid: context.read().uid, + scaleType: widget.scaleType, + avatarTitleFontSize: widget.avatarTitleFontSize, + avatarRadius: widget.avatarRadius, + avatarTitleTextLineHeight: + widget.avatarTitleTextLineHeight, ), - ), - ) - : Semantics( - label: - "fl_${context.read().peer.name}_screen_share_tile", - child: LayoutBuilder( - builder: (context, BoxConstraints constraints) { - return Container( - decoration: BoxDecoration( - border: Border.all( - color: HMSThemeColors.surfaceDim, width: 1.0), - color: Colors.transparent, - borderRadius: - const BorderRadius.all(Radius.circular(10))), - key: key, - child: Stack( - children: [ - VideoView( - uid: context.read().uid, - scaleType: widget.scaleType, - ), - Positioned( - top: 5, - right: 5, - child: GestureDetector( - ///This is to show the screenshare in full screen - onTap: () { - showGeneralDialog( - context: context, - transitionBuilder: (dialogContext, - animation, - secondaryAnimation, - value) { - if (mounted) { - ///Setting the screenshare context - ///in the meeting store to store the current context - ///so that we can pop the dialog from the meeting store when screenshare is stopped - context - .read() - .screenshareContext = - dialogContext; - } + Semantics( + label: + "fl_${context.read().peer.name}_degraded_tile", + child: const DegradeTile(), + ), + NameAndNetwork(maxWidth: constraints.maxWidth), + const HandRaise(), //top left + const BRBTag(), //top left + const AudioMuteStatus(), //top right + context.read().peer.isLocal + ? const LocalPeerMoreOption( + isInsetTile: false, + ) + : const MoreOption(), //bottom right + Semantics( + label: "fl_stats_on_tile", + child: RTCStatsView( + isLocal: + context.read().peer.isLocal), + ) + ], + ), + ), + ) + : Semantics( + label: + "fl_${context.read().peer.name}_screen_share_tile", + child: LayoutBuilder( + builder: (context, BoxConstraints constraints) { + return Container( + decoration: BoxDecoration( + border: Border.all( + color: HMSThemeColors.surfaceDim, width: 1.0), + color: Colors.transparent, + borderRadius: + const BorderRadius.all(Radius.circular(10))), + key: key, + child: Stack( + children: [ + VideoView( + uid: context.read().uid, + scaleType: widget.scaleType, + ), + Positioned( + top: 5, + right: 5, + child: GestureDetector( + ///This is to show the screenshare in full screen + onTap: () { + showGeneralDialog( + context: context, + transitionBuilder: (dialogContext, + animation, + secondaryAnimation, + value) { + if (mounted) { + ///Setting the screenshare context + ///in the meeting store to store the current context + ///so that we can pop the dialog from the meeting store when screenshare is stopped + context + .read() + .screenshareContext = + dialogContext; + } - ///Here we check whether the full screen screenshare is mounted or not - return context.mounted - ? Transform.scale( - scale: animation.value, - child: Opacity( - opacity: animation.value, - child: ListenableProvider - .value( - value: context.read< - PeerTrackNode>(), - child: Scaffold( - body: SafeArea( - child: Container( - color: HMSThemeColors - .backgroundDim, - height: - MediaQuery.of( - context) - .size - .height, - width: - MediaQuery.of( - context) - .size - .width, - child: Stack( - children: [ - InteractiveViewer( - child: ListenableProvider - .value( - value: context - .read< - MeetingStore>(), - child: - VideoView( - uid: context - .read() - .uid, - scaleType: - widget.scaleType, - ), - ), + ///Here we check whether the full screen screenshare is mounted or not + return context.mounted + ? Transform.scale( + scale: animation.value, + child: Opacity( + opacity: animation.value, + child: ListenableProvider + .value( + value: context.read< + PeerTrackNode>(), + child: Scaffold( + body: SafeArea( + child: Container( + color: HMSThemeColors + .backgroundDim, + height: + MediaQuery.of( + context) + .size + .height, + width: + MediaQuery.of( + context) + .size + .width, + child: Stack( + children: [ + InteractiveViewer( + child: ListenableProvider + .value( + value: context + .read< + MeetingStore>(), + child: + VideoView( + uid: context + .read() + .uid, + scaleType: + widget.scaleType, ), - Positioned( - top: 5, - right: 5, - child: - GestureDetector( - onTap: - () { - Navigator.pop( - dialogContext); - context - .read() - .screenshareContext = null; - }, - child: - Container( - height: - 40, - width: - 40, - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim.withAlpha(64), - borderRadius: BorderRadius.circular(8)), - child: - Center( - child: - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/minimize.svg", - height: 16, - width: 16, - semanticsLabel: "minimize_label", - colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), - ), - ), - ), - )), - Positioned( - //Bottom left - bottom: 5, - left: 5, + ), + ), + Positioned( + top: 5, + right: 5, + child: + GestureDetector( + onTap: + () { + Navigator.pop( + dialogContext); + context + .read() + .screenshareContext = null; + }, child: Container( + height: + 40, + width: + 40, decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim.withOpacity( - 0.64), - borderRadius: - BorderRadius.circular(8)), + color: HMSThemeColors.backgroundDim.withAlpha(64), + borderRadius: BorderRadius.circular(8)), child: Center( child: - Padding( - padding: const EdgeInsets - .only( - left: 8.0, - right: 4, - top: 4, - bottom: 4), - child: - Row( - mainAxisSize: - MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", - height: 20, - width: 20, - colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), - ), - const SizedBox( - width: 6, - ), - ScreenshareTileName(maxWidth: constraints.maxWidth) - ], - ), + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/minimize.svg", + height: 16, + width: 16, + semanticsLabel: "minimize_label", + colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), ), ), ), + )), + Positioned( + //Bottom left + bottom: 5, + left: 5, + child: + Container( + decoration: BoxDecoration( + color: HMSThemeColors.backgroundDim.withOpacity( + 0.64), + borderRadius: + BorderRadius.circular(8)), + child: + Center( + child: + Padding( + padding: const EdgeInsets + .only( + left: 8.0, + right: 4, + top: 4, + bottom: 4), + child: + Row( + mainAxisSize: + MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", + height: 20, + width: 20, + colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), + ), + const SizedBox( + width: 6, + ), + ScreenshareTileName(maxWidth: constraints.maxWidth) + ], + ), + ), ), - ], + ), ), - ), + ], ), ), - )), - ) - : Container(); - }, - pageBuilder: (ctx, animation, - secondaryAnimation) { - return Container(); - }); - }, - child: Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim - .withAlpha(64), - borderRadius: BorderRadius.circular(8)), - child: Center( - child: SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/maximize.svg", - height: 16, - width: 16, - semanticsLabel: "maximize_label", - colorFilter: ColorFilter.mode( - HMSThemeColors - .onSurfaceHighEmphasis, - BlendMode.srcIn), - ), - ), - ), - )), - Positioned( - //Bottom left - bottom: 5, - left: 5, + ), + ), + )), + ) + : Container(); + }, + pageBuilder: (ctx, animation, + secondaryAnimation) { + return Container(); + }); + }, child: Container( + height: 40, + width: 40, decoration: BoxDecoration( color: HMSThemeColors.backgroundDim - .withOpacity(0.64), + .withAlpha(64), borderRadius: BorderRadius.circular(8)), child: Center( - child: Padding( - padding: const EdgeInsets.only( - left: 8.0, right: 4, top: 4, bottom: 4), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", - height: 20, - width: 20, - colorFilter: ColorFilter.mode( - HMSThemeColors - .onSurfaceHighEmphasis, - BlendMode.srcIn), - ), - const SizedBox( - width: 6, - ), - ScreenshareTileName( - maxWidth: constraints.maxWidth) - ], - ), + child: SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/maximize.svg", + height: 16, + width: 16, + semanticsLabel: "maximize_label", + colorFilter: ColorFilter.mode( + HMSThemeColors + .onSurfaceHighEmphasis, + BlendMode.srcIn), ), ), ), + )), + Positioned( + //Bottom left + bottom: 5, + left: 5, + child: Container( + decoration: BoxDecoration( + color: HMSThemeColors.backgroundDim + .withOpacity(0.64), + borderRadius: BorderRadius.circular(8)), + child: Center( + child: Padding( + padding: const EdgeInsets.only( + left: 8.0, right: 4, top: 4, bottom: 4), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", + height: 20, + width: 20, + colorFilter: ColorFilter.mode( + HMSThemeColors + .onSurfaceHighEmphasis, + BlendMode.srcIn), + ), + const SizedBox( + width: 6, + ), + ScreenshareTileName( + maxWidth: constraints.maxWidth) + ], + ), + ), ), - const RTCStatsView(isLocal: false), - ], + ), ), - ); - }), + const RTCStatsView(isLocal: false), + ], + ), ); - })), + }), + ); + }), ); } } diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index 9bcc19af0..c33fd1a6f 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -53,11 +53,11 @@ class _VideoViewState extends State { @override Widget build(BuildContext context) { ///We use the [Selector] widget to rebuild the widget when the peer track node changes - return Selector>( + return Selector>( builder: (_, data, __) { ///If the peer track node is null or the peer is muted or the peer is offscreen ///We render the avatar - if ((data.item1 == null) || data.item2 || data.item3) { + if ((data.item1 == null) || data.item2) { return Semantics( label: "fl_video_off", child: AudioLevelAvatar( @@ -109,9 +109,8 @@ class _VideoViewState extends State { ); } }, - selector: (_, peerTrackNode) => Tuple3( + selector: (_, peerTrackNode) => Tuple2( peerTrackNode.track, - (peerTrackNode.isOffscreen), (peerTrackNode.track?.isMute ?? true))); } } diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index c5e6f9c0d..f63709196 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -605,6 +605,14 @@ class HmssdkFlutterPlugin : val trackId = call.argument("track_id") trackId?.let { + if(renderers.containsKey(it)){ + val renderer = renderers[it] + renderer?.addTrack() + val data = HashMap() + data["texture_id"] = renderer?.uid!! + result.success(HMSResultExtension.toDictionary(true,data)) + return + } val room = hmssdk?.getRoom() room?.let { currentRoom -> @@ -614,7 +622,7 @@ class HmssdkFlutterPlugin : entry?.let { surfaceTextureEntry -> val surfaceTexture = surfaceTextureEntry.surfaceTexture() val renderer = HMSTextureView(surfaceTexture,videoTrack,entry) - renderers["${entry.id()}$trackId"] = renderer + renderers["$trackId"] = renderer // val eventChannel = EventChannel( // hmsBinaryMessenger, // "HMSTextureView/Texture" + entry.id() diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 866aa8cf0..f093af500 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -10,15 +10,21 @@ import live.hms.videoview.textureview.HMSTextureRenderer class HMSTextureView( texture: SurfaceTexture, - track: HMSVideoTrack, + val track: HMSVideoTrack, var entry: TextureRegistry.SurfaceTextureEntry? ){ // var eventChannel: EventChannel? = null // var eventSink: EventSink? = null var hmsTextureRenderer: HMSTextureRenderer? = null + var uid: Long? = null init { hmsTextureRenderer = HMSTextureRenderer(texture) + addTrack() + uid = entry?.id() + } + + fun addTrack(){ hmsTextureRenderer?.addTrack(track) } diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index f24f9f33c..794645e6e 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -1,4 +1,5 @@ // Dart imports: +import 'dart:developer'; import 'dart:io' show Platform; // Flutter imports: @@ -124,7 +125,6 @@ class _PlatformView extends StatefulWidget { } class _PlatformViewState extends State<_PlatformView> { - int? textureId; void onPlatformViewCreated(int id) {} @@ -141,19 +141,26 @@ class _PlatformViewState extends State<_PlatformView> { super.dispose(); } - void getTextureId() async{ - var result = await PlatformService.invokeMethod(PlatformMethod.createTextureView, + void getTextureId() async { + log("getTextureId 1 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); + var result = await PlatformService.invokeMethod( + PlatformMethod.createTextureView, arguments: {"track_id": widget.track.trackId}); if (result["success"] && mounted) { setState(() { textureId = result["data"]["texture_id"]; }); + log("getTextureId 2 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); } } - void disposeTextureView() async{ - var result = await PlatformService.invokeMethod(PlatformMethod.disposeTextureView, - arguments: {"track_id": widget.track.trackId,"texture_id":textureId.toString()}); + void disposeTextureView() async { + var result = await PlatformService.invokeMethod( + PlatformMethod.disposeTextureView, + arguments: { + "track_id": widget.track.trackId, + "texture_id": textureId.toString() + }); if (result["success"] && mounted) { setState(() { textureId = null; @@ -165,9 +172,8 @@ class _PlatformViewState extends State<_PlatformView> { Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return - textureId == null ? Container() : Texture(textureId: textureId!); - + return textureId == null ? Container(color: Colors.red,) : Texture(textureId: textureId!); + // /Texture(textureId: textureId); // get textureId fom video view // return AndroidView( // viewType: 'HMSVideoView', From fa02140eca8db0c7df3cf36d1c6fd100b5868f9b Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 18 Oct 2023 16:39:11 +0530 Subject: [PATCH 08/53] Updated implementation --- .../lib/src/hmssdk_interactor.dart | 8 + .../lib/src/meeting/meeting_store.dart | 8 + .../lib/src/model/peer_track_node.dart | 39 +- .../widgets/common_widgets/degrade_tile.dart | 51 +- .../src/widgets/common_widgets/peer_tile.dart | 577 ++++++++++-------- .../widgets/common_widgets/video_view.dart | 1 + .../grid_layouts/texture_view_grid.dart | 29 + .../meeting_modes/custom_one_to_one_grid.dart | 59 +- packages/hms_room_kit/pubspec.yaml | 3 +- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 31 +- .../hmssdk_flutter/views/HMSTextureView.kt | 9 +- .../example/android/app/build.gradle | 4 +- .../lib/src/common/platform_methods.dart | 12 +- packages/hmssdk_flutter/lib/src/hmssdk.dart | 16 + 14 files changed, 507 insertions(+), 340 deletions(-) create mode 100644 packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart diff --git a/packages/hms_room_kit/lib/src/hmssdk_interactor.dart b/packages/hms_room_kit/lib/src/hmssdk_interactor.dart index 558007313..67087217f 100644 --- a/packages/hms_room_kit/lib/src/hmssdk_interactor.dart +++ b/packages/hms_room_kit/lib/src/hmssdk_interactor.dart @@ -413,4 +413,12 @@ class HMSSDKInteractor { hmsSDK.lowerRemotePeerHand( forPeer: forPeer, hmsActionResultListener: hmsActionResultListener); } + + void addTrack({required HMSVideoTrack track}) { + hmsSDK.addTrack(track: track); + } + + void removeTrack({required HMSVideoTrack track}) { + hmsSDK.removeTrack(track: track); + } } diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 4e0e9f241..1295ba288 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1823,6 +1823,14 @@ class MeetingStore extends ChangeNotifier } } + void addTrack({required HMSVideoTrack track}) { + _hmsSDKInteractor.addTrack(track: track); + } + + void removeTrack({required HMSVideoTrack track}) { + _hmsSDKInteractor.removeTrack(track: track); + } + HMSAudioFilePlayerNode audioFilePlayerNode = HMSAudioFilePlayerNode("audioFilePlayerNode"); HMSMicNode micNode = HMSMicNode(); diff --git a/packages/hms_room_kit/lib/src/model/peer_track_node.dart b/packages/hms_room_kit/lib/src/model/peer_track_node.dart index 0314139a1..d891615e8 100644 --- a/packages/hms_room_kit/lib/src/model/peer_track_node.dart +++ b/packages/hms_room_kit/lib/src/model/peer_track_node.dart @@ -14,6 +14,7 @@ class PeerTrackNode extends ChangeNotifier { RTCStats? stats; int audioLevel; bool pinTile; + bool isOffscreen = false; PeerTrackNode( {required this.peer, @@ -35,51 +36,51 @@ class PeerTrackNode extends ChangeNotifier { } void setOffScreenStatus(bool currentState) { - // isOffscreen = currentState; + isOffscreen = currentState; notify(); } void setAudioLevel(int audioLevel) { this.audioLevel = audioLevel; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } void setNetworkQuality(int? networkQuality) { if (networkQuality != null) { this.networkQuality = networkQuality; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } } void setHMSRemoteAudioStats(HMSRemoteAudioStats hmsRemoteAudioStats) { stats?.hmsRemoteAudioStats = hmsRemoteAudioStats; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } void setHMSRemoteVideoStats(HMSRemoteVideoStats hmsRemoteVideoStats) { stats?.hmsRemoteVideoStats = hmsRemoteVideoStats; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } void setHMSLocalVideoStats(List hmsLocalVideoStats) { stats?.hmsLocalVideoStats = hmsLocalVideoStats; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } void setHMSLocalAudioStats(HMSLocalAudioStats hmsLocalAudioStats) { stats?.hmsLocalAudioStats = hmsLocalAudioStats; - // if (!isOffscreen) { - // notify(); - // } + if (!isOffscreen) { + notify(); + } } } diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart index 433b48d15..dc7b2c32a 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart @@ -40,34 +40,31 @@ class _DegradeTileState extends State { ClipRRect( ///Here we are using a backdrop filter to blur the background ///when the connection is poor - child: BackdropFilter( - filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10), - child: Container( - color: Colors.transparent, + child: Container( + color: Colors.black.withOpacity(0.5), + alignment: Alignment.center, + child: Align( alignment: Alignment.center, - child: Align( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - HMSSubheadingText( - text: "Poor connection", - textColor: - HMSThemeColors.onSurfaceHighEmphasis, - fontWeight: FontWeight.w600, - letterSpacing: 0.1, - ), - const SizedBox( - height: 4, - ), - HMSSubtitleText( - text: - "The video will resume\n automatically when the\n connection improves", - textColor: - HMSThemeColors.onSurfaceHighEmphasis, - ) - ], - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + HMSSubheadingText( + text: "Poor connection", + textColor: + HMSThemeColors.onSurfaceHighEmphasis, + fontWeight: FontWeight.w600, + letterSpacing: 0.1, + ), + const SizedBox( + height: 4, + ), + HMSSubtitleText( + text: + "The video will resume\n automatically when the\n connection improves", + textColor: + HMSThemeColors.onSurfaceHighEmphasis, + ) + ], ), ), ), diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index 1b942b765..0797326cf 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:focus_detector/focus_detector.dart'; +import 'package:hms_room_kit/src/widgets/peer_widgets/audio_level_avatar.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:provider/provider.dart'; @@ -55,298 +56,356 @@ class _PeerTileState extends State { Widget build(BuildContext context) { return Semantics( label: "fl_${context.read().peer.name}_video_tile", - child: LayoutBuilder(builder: (context, BoxConstraints constraints) { - return context.read().uid.contains("mainVideo") - ? Container( - key: key, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: HMSThemeColors.backgroundDefault, - ), - child: Semantics( - label: - "fl_${context.read().peer.name}_video_on", - child: Stack( - children: [ - VideoView( - uid: context.read().uid, - scaleType: widget.scaleType, - avatarTitleFontSize: widget.avatarTitleFontSize, - avatarRadius: widget.avatarRadius, - avatarTitleTextLineHeight: - widget.avatarTitleTextLineHeight, - ), - Semantics( - label: - "fl_${context.read().peer.name}_degraded_tile", - child: const DegradeTile(), - ), - NameAndNetwork(maxWidth: constraints.maxWidth), - const HandRaise(), //top left - const BRBTag(), //top left - const AudioMuteStatus(), //top right - context.read().peer.isLocal - ? const LocalPeerMoreOption( - isInsetTile: false, - ) - : const MoreOption(), //bottom right - Semantics( - label: "fl_stats_on_tile", - child: RTCStatsView( - isLocal: - context.read().peer.isLocal), - ) - ], + child: FocusDetector( + onFocusLost: () { + if (mounted) { + Provider.of(context, listen: false) + .setOffScreenStatus(true); + if (context.read().track != null) { + context + .read() + .removeTrack(track: context.read().track!); + } + } + }, + onFocusGained: () { + Provider.of(context, listen: false) + .setOffScreenStatus(false); + if (context.read().track != null) { + context + .read() + .addTrack(track: context.read().track!); + } + }, + child: LayoutBuilder(builder: (context, BoxConstraints constraints) { + return context.read().uid.contains("mainVideo") + ? Container( + key: key, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HMSThemeColors.backgroundDefault, ), - ), - ) - : Semantics( - label: - "fl_${context.read().peer.name}_screen_share_tile", - child: LayoutBuilder( - builder: (context, BoxConstraints constraints) { - return Container( - decoration: BoxDecoration( - border: Border.all( - color: HMSThemeColors.surfaceDim, width: 1.0), - color: Colors.transparent, - borderRadius: - const BorderRadius.all(Radius.circular(10))), - key: key, + child: Semantics( + label: + "fl_${context.read().peer.name}_video_on", child: Stack( children: [ VideoView( uid: context.read().uid, scaleType: widget.scaleType, + avatarTitleFontSize: widget.avatarTitleFontSize, + avatarRadius: widget.avatarRadius, + avatarTitleTextLineHeight: + widget.avatarTitleTextLineHeight, + ), + Semantics( + label: + "fl_${context.read().peer.name}_degraded_tile", + child: const DegradeTile(), ), - Positioned( - top: 5, - right: 5, - child: GestureDetector( - ///This is to show the screenshare in full screen - onTap: () { - showGeneralDialog( - context: context, - transitionBuilder: (dialogContext, - animation, - secondaryAnimation, - value) { - if (mounted) { - ///Setting the screenshare context - ///in the meeting store to store the current context - ///so that we can pop the dialog from the meeting store when screenshare is stopped - context - .read() - .screenshareContext = - dialogContext; - } + Selector( + selector: (_, peerTrackNode) => + peerTrackNode.isOffscreen, + builder: (_, isOffScreen, __) { + return isOffScreen + ? Semantics( + label: "fl_video_off", + child: Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.circular(10), + color: + HMSThemeColors.backgroundDefault, + ), + child: AudioLevelAvatar( + avatarRadius: widget.avatarRadius, + avatarTitleFontSize: + widget.avatarTitleFontSize, + avatarTitleTextLineHeight: + widget.avatarTitleTextLineHeight, + ), + )) + : Container(); + }), + NameAndNetwork(maxWidth: constraints.maxWidth), + const HandRaise(), //top left + const BRBTag(), //top left + const AudioMuteStatus(), //top right + context.read().peer.isLocal + ? const LocalPeerMoreOption( + isInsetTile: false, + ) + : const MoreOption(), //bottom right + Semantics( + label: "fl_stats_on_tile", + child: RTCStatsView( + isLocal: + context.read().peer.isLocal), + ) + ], + ), + ), + ) + : Semantics( + label: + "fl_${context.read().peer.name}_screen_share_tile", + child: LayoutBuilder( + builder: (context, BoxConstraints constraints) { + return Container( + decoration: BoxDecoration( + border: Border.all( + color: HMSThemeColors.surfaceDim, width: 1.0), + color: Colors.transparent, + borderRadius: + const BorderRadius.all(Radius.circular(10))), + key: key, + child: Stack( + children: [ + VideoView( + uid: context.read().uid, + scaleType: widget.scaleType, + ), + Positioned( + top: 5, + right: 5, + child: GestureDetector( + ///This is to show the screenshare in full screen + onTap: () { + showGeneralDialog( + context: context, + transitionBuilder: (dialogContext, + animation, + secondaryAnimation, + value) { + if (mounted) { + ///Setting the screenshare context + ///in the meeting store to store the current context + ///so that we can pop the dialog from the meeting store when screenshare is stopped + context + .read() + .screenshareContext = + dialogContext; + } - ///Here we check whether the full screen screenshare is mounted or not - return context.mounted - ? Transform.scale( - scale: animation.value, - child: Opacity( - opacity: animation.value, - child: ListenableProvider - .value( - value: context.read< - PeerTrackNode>(), - child: Scaffold( - body: SafeArea( - child: Container( - color: HMSThemeColors - .backgroundDim, - height: - MediaQuery.of( - context) - .size - .height, - width: - MediaQuery.of( - context) - .size - .width, - child: Stack( - children: [ - InteractiveViewer( - child: ListenableProvider - .value( - value: context - .read< - MeetingStore>(), + ///Here we check whether the full screen screenshare is mounted or not + return context.mounted + ? Transform.scale( + scale: animation.value, + child: Opacity( + opacity: animation.value, + child: ListenableProvider + .value( + value: context.read< + PeerTrackNode>(), + child: Scaffold( + body: SafeArea( + child: Container( + color: HMSThemeColors + .backgroundDim, + height: + MediaQuery.of( + context) + .size + .height, + width: + MediaQuery.of( + context) + .size + .width, + child: Stack( + children: [ + InteractiveViewer( child: - VideoView( - uid: context - .read() - .uid, - scaleType: - widget.scaleType, + ListenableProvider + .value( + value: context + .read< + MeetingStore>(), + child: + VideoView( + uid: context + .read< + PeerTrackNode>() + .uid, + scaleType: + widget + .scaleType, + ), ), ), - ), - Positioned( - top: 5, - right: 5, - child: - GestureDetector( - onTap: - () { - Navigator.pop( - dialogContext); - context - .read() - .screenshareContext = null; - }, + Positioned( + top: 5, + right: 5, child: - Container( - height: - 40, - width: - 40, - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim.withAlpha(64), - borderRadius: BorderRadius.circular(8)), + GestureDetector( + onTap: + () { + Navigator.pop( + dialogContext); + context + .read() + .screenshareContext = null; + }, child: - Center( + Container( + height: + 40, + width: + 40, + decoration: BoxDecoration( + color: + HMSThemeColors.backgroundDim.withAlpha(64), + borderRadius: BorderRadius.circular(8)), child: - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/minimize.svg", - height: 16, - width: 16, - semanticsLabel: "minimize_label", - colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), + Center( + child: + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/minimize.svg", + height: + 16, + width: + 16, + semanticsLabel: + "minimize_label", + colorFilter: + ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), + ), ), ), - ), - )), - Positioned( - //Bottom left - bottom: 5, - left: 5, - child: - Container( - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim.withOpacity( - 0.64), - borderRadius: - BorderRadius.circular(8)), + )), + Positioned( + //Bottom left + bottom: 5, + left: 5, child: - Center( + Container( + decoration: BoxDecoration( + color: HMSThemeColors + .backgroundDim + .withOpacity( + 0.64), + borderRadius: + BorderRadius.circular(8)), child: - Padding( - padding: const EdgeInsets - .only( - left: 8.0, - right: 4, - top: 4, - bottom: 4), + Center( child: - Row( - mainAxisSize: - MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", - height: 20, - width: 20, - colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), - ), - const SizedBox( - width: 6, - ), - ScreenshareTileName(maxWidth: constraints.maxWidth) - ], + Padding( + padding: const EdgeInsets + .only( + left: + 8.0, + right: + 4, + top: + 4, + bottom: + 4), + child: + Row( + mainAxisSize: + MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", + height: 20, + width: 20, + colorFilter: ColorFilter.mode(HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), + ), + const SizedBox( + width: 6, + ), + ScreenshareTileName(maxWidth: constraints.maxWidth) + ], + ), ), ), ), ), - ), - ], + ], + ), ), ), ), - ), - )), - ) - : Container(); - }, - pageBuilder: (ctx, animation, - secondaryAnimation) { - return Container(); - }); - }, - child: Container( - height: 40, - width: 40, - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim - .withAlpha(64), - borderRadius: BorderRadius.circular(8)), - child: Center( - child: SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/maximize.svg", - height: 16, - width: 16, - semanticsLabel: "maximize_label", - colorFilter: ColorFilter.mode( - HMSThemeColors - .onSurfaceHighEmphasis, - BlendMode.srcIn), - ), - ), - ), - )), - Positioned( - //Bottom left - bottom: 5, - left: 5, - child: Container( - decoration: BoxDecoration( - color: HMSThemeColors.backgroundDim - .withOpacity(0.64), - borderRadius: BorderRadius.circular(8)), - child: Center( - child: Padding( - padding: const EdgeInsets.only( - left: 8.0, right: 4, top: 4, bottom: 4), - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: - CrossAxisAlignment.center, - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - SvgPicture.asset( - "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", - height: 20, - width: 20, + )), + ) + : Container(); + }, + pageBuilder: + (ctx, animation, secondaryAnimation) { + return Container(); + }); + }, + child: Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: HMSThemeColors.backgroundDim + .withAlpha(64), + borderRadius: BorderRadius.circular(8)), + child: Center( + child: SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/maximize.svg", + height: 16, + width: 16, + semanticsLabel: "maximize_label", colorFilter: ColorFilter.mode( - HMSThemeColors - .onSurfaceHighEmphasis, + HMSThemeColors.onSurfaceHighEmphasis, BlendMode.srcIn), ), - const SizedBox( - width: 6, - ), - ScreenshareTileName( - maxWidth: constraints.maxWidth) - ], + ), + ), + )), + Positioned( + //Bottom left + bottom: 5, + left: 5, + child: Container( + decoration: BoxDecoration( + color: HMSThemeColors.backgroundDim + .withOpacity(0.64), + borderRadius: BorderRadius.circular(8)), + child: Center( + child: Padding( + padding: const EdgeInsets.only( + left: 8.0, right: 4, top: 4, bottom: 4), + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: + CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SvgPicture.asset( + "packages/hms_room_kit/lib/src/assets/icons/screen_share.svg", + height: 20, + width: 20, + colorFilter: ColorFilter.mode( + HMSThemeColors + .onSurfaceHighEmphasis, + BlendMode.srcIn), + ), + const SizedBox( + width: 6, + ), + ScreenshareTileName( + maxWidth: constraints.maxWidth) + ], + ), ), ), ), ), - ), - const RTCStatsView(isLocal: false), - ], - ), - ); - }), - ); - }), + const RTCStatsView(isLocal: false), + ], + ), + ); + }), + ); + }), + ), ); } } diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index c33fd1a6f..dedc116b9 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -91,6 +91,7 @@ class _VideoViewState extends State { ), ) : ClipRRect( + clipBehavior: Clip.none, borderRadius: const BorderRadius.all( Radius.circular(10), ), diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart new file mode 100644 index 000000000..d55f8f7bc --- /dev/null +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart @@ -0,0 +1,29 @@ +import 'package:flutter/cupertino.dart'; +import 'package:hms_room_kit/src/model/peer_track_node.dart'; +import 'package:hms_room_kit/src/widgets/grid_layouts/listenable_peer_widget.dart'; + +class TextureViewGrid extends StatefulWidget { + final List peerTracks; + const TextureViewGrid({super.key, required this.peerTracks}); + + @override + State createState() => _TextureViewGridState(); +} + +class _TextureViewGridState extends State { + @override + Widget build(BuildContext context) { + return GridView.builder( + scrollDirection: Axis.horizontal, + physics: const PageScrollPhysics(), + gridDelegate: + SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3,mainAxisExtent: MediaQuery.of(context).size.width/2), + itemCount: widget.peerTracks.length, + itemBuilder: (context, index) { + return ListenablePeerWidget( + peerTracks: widget.peerTracks, + index: index, + ); + }); + } +} diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index d4e87d87d..aac0785f9 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -1,6 +1,7 @@ ///Package imports import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; +import 'package:hms_room_kit/src/widgets/grid_layouts/texture_view_grid.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; @@ -65,32 +66,40 @@ class _CustomOneToOneGridState extends State { Column( children: [ Expanded( - child: PageView.builder( - physics: const PageScrollPhysics(), - controller: controller, - allowImplicitScrolling: true, - itemCount: pageCount, - onPageChanged: (newPage) { - context - .read() - .setCurrentPage(newPage); - }, - itemBuilder: (context, index) => GridLayout( - numberOfTiles: numberOfPeers, - index: index, + child: TextureViewGrid( + peerTracks: widget.isLocalInsetPresent + ? data.item1 + .where((element) => + !(element.peer.isLocal) || + element.track?.source == "SCREEN") + .toList() + : data.item1), + // child: PageView.builder( + // physics: const PageScrollPhysics(), + // controller: controller, + // allowImplicitScrolling: true, + // itemCount: pageCount, + // onPageChanged: (newPage) { + // context + // .read() + // .setCurrentPage(newPage); + // }, + // itemBuilder: (context, index) => GridLayout( + // numberOfTiles: numberOfPeers, + // index: index, - ///Here we filter out the local peer since we are rendering the local peer in the inset tile iff isLocalInsetPresent is true - ///We only take the screenshare or remote peers - /// - ///If isLocalInsetPresent is false we render all the peers in grid layout - ///Since the screenshare case is already handled above the code never reaches here - peerTracks: widget.isLocalInsetPresent - ? data.item1 - .where((element) => - !(element.peer.isLocal) || - element.track?.source == "SCREEN") - .toList() - : data.item1)), + // ///Here we filter out the local peer since we are rendering the local peer in the inset tile iff isLocalInsetPresent is true + // ///We only take the screenshare or remote peers + // /// + // ///If isLocalInsetPresent is false we render all the peers in grid layout + // ///Since the screenshare case is already handled above the code never reaches here + // peerTracks: widget.isLocalInsetPresent + // ? data.item1 + // .where((element) => + // !(element.peer.isLocal) || + // element.track?.source == "SCREEN") + // .toList() + // : data.item1)), ), ///This renders the dots at the bottom of the grid view diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index 198e557e3..e2474f42e 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -14,7 +14,8 @@ dependencies: flutter: sdk: flutter - hmssdk_flutter: ^1.9.0 + hmssdk_flutter: + path: ../hmssdk_flutter intl: ^0.18.1 permission_handler: ^11.0.0 provider: ^6.0.5 diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index f63709196..69cca8e82 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -261,6 +261,14 @@ class HmssdkFlutterPlugin : disposeTextureView(call, result) } + "add_track" -> { + addTrack(call,result) + } + + "remove_track" -> { + removeTrack(call,result) + } + "get_peer_list_iterator", "peer_list_iterator_has_next", "peer_list_iterator_next" -> { HMSPeerListIteratorAction.peerListIteratorAction(call, result, hmssdk!!) } @@ -630,7 +638,6 @@ class HmssdkFlutterPlugin : // eventChannel.setStreamHandler(renderer) // renderer.setTextureViewEventChannel(eventChannel) - Log.i("HMSTextureView","createTextureView renderer size is ${renderers.size}") val data = HashMap() data["texture_id"] = surfaceTextureEntry.id() @@ -657,15 +664,13 @@ class HmssdkFlutterPlugin : private fun disposeTextureView(call: MethodCall,result: Result){ val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") - val textureId = call.argument("texture_id") ?: HMSErrorLogger.returnArgumentsError("textureId is null") - var renderer = renderers["$textureId$trackId"] + var renderer = renderers["$trackId"] if(renderer != null){ renderer.disposeTextureView() - Log.i("HMSTextureView","disposeTextureView renderer size is ${renderers.size}") renderer = null - renderers.remove("$textureId$trackId") + renderers.remove("$trackId") result.success(HMSResultExtension.toDictionary(true,null)) } else { @@ -678,6 +683,22 @@ class HmssdkFlutterPlugin : } } + private fun addTrack(call: MethodCall, result: Result){ + val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") + val renderer = renderers["$trackId"] + renderer?.addTrack() + result.success(null) + } + + private fun removeTrack(call: MethodCall, result: Result){ + val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") + + val renderer = renderers["$trackId"] + renderer?.removeTrack() + result.success(null) + + } + private fun getAllTracks(): ArrayList { val room = hmssdk!!.getRoom() val allTracks = ArrayList() diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index f093af500..25cde3ee8 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -20,16 +20,23 @@ class HMSTextureView( var uid: Long? = null init { hmsTextureRenderer = HMSTextureRenderer(texture) + Log.i("HMSTextureView","creating texture view $entry $hmsTextureRenderer") addTrack() uid = entry?.id() } fun addTrack(){ + Log.i("HMSTextureView","Add Track called for track: ${track.trackId}") hmsTextureRenderer?.addTrack(track) } + fun removeTrack(){ + Log.i("HMSTextureView","Remove Track called for track: ${track.trackId}") + hmsTextureRenderer?.removeTrack() + } + fun disposeTextureView(){ - Log.i("HMSTextureView","Inside disposeTextureView $entry $hmsTextureRenderer") + Log.i("HMSTextureView","disposeTextureView $entry $hmsTextureRenderer") hmsTextureRenderer?.removeTrack() entry?.release() entry = null diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 7e316683d..382e35c22 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 373 - versionName "1.5.73" + versionCode 375 + versionName "1.5.75" } signingConfigs { diff --git a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart index 95e1309bb..a552ce571 100644 --- a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart +++ b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart @@ -197,7 +197,9 @@ enum PlatformMethod { lowerRemotePeerHand, raiseLocalPeerHand, createTextureView, - disposeTextureView + disposeTextureView, + addTrack, + removeTrack } extension PlatformMethodValues on PlatformMethod { @@ -494,6 +496,10 @@ extension PlatformMethodValues on PlatformMethod { return "create_texture_view"; case PlatformMethod.disposeTextureView: return "dispose_texture_view"; + case PlatformMethod.addTrack: + return "add_track"; + case PlatformMethod.removeTrack: + return "remove_track"; default: return 'unknown'; } @@ -792,6 +798,10 @@ extension PlatformMethodValues on PlatformMethod { return PlatformMethod.createTextureView; case "dispose_texture_view": return PlatformMethod.disposeTextureView; + case "add_track": + return PlatformMethod.addTrack; + case "remove_track": + return PlatformMethod.removeTrack; default: return PlatformMethod.unknown; } diff --git a/packages/hmssdk_flutter/lib/src/hmssdk.dart b/packages/hmssdk_flutter/lib/src/hmssdk.dart index fe28339d6..cd8fadf97 100644 --- a/packages/hmssdk_flutter/lib/src/hmssdk.dart +++ b/packages/hmssdk_flutter/lib/src/hmssdk.dart @@ -1474,6 +1474,22 @@ class HMSSDK { } } + void addTrack({required HMSVideoTrack track}){ + PlatformService.invokeMethod( + PlatformMethod.addTrack, + arguments: { + "track_id":track.trackId, + }); + } + + void removeTrack({required HMSVideoTrack track}){ + PlatformService.invokeMethod( + PlatformMethod.removeTrack, + arguments: { + "track_id": track.trackId, + }); + } + /// To modify local peer's audio & video tracks settings use the [hmsTrackSetting]. Only required for advanced use cases. HMSTrackSetting? hmsTrackSetting; From 0a0d09d11a3af100f223f3cfc18e064fa84b16d2 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 19 Oct 2023 16:24:09 +0530 Subject: [PATCH 09/53] Updated cache extent and add track logic --- .../src/widgets/common_widgets/peer_tile.dart | 4 ++++ .../widgets/common_widgets/video_view.dart | 12 +++++++---- .../grid_layouts/texture_view_grid.dart | 1 + .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 5 +++++ .../hmssdk_flutter/views/HMSTextureView.kt | 6 +++--- packages/hmssdk_flutter/lib/src/hmssdk.dart | 8 +++---- .../lib/src/ui/meeting/hms_video_view.dart | 21 ++++++++++++++----- 7 files changed, 41 insertions(+), 16 deletions(-) diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index 0797326cf..157a51afb 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -1,4 +1,6 @@ // Package imports +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:focus_detector/focus_detector.dart'; @@ -65,6 +67,7 @@ class _PeerTileState extends State { context .read() .removeTrack(track: context.read().track!); + log("getTextureId Track Removed for peer: ${context.read().peer.name}"); } } }, @@ -76,6 +79,7 @@ class _PeerTileState extends State { .read() .addTrack(track: context.read().track!); } + log("getTextureId Track Added for peer: ${context.read().peer.name}"); }, child: LayoutBuilder(builder: (context, BoxConstraints constraints) { return context.read().uid.contains("mainVideo") diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index dedc116b9..f2a62a095 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -1,4 +1,6 @@ //Package imports +import 'dart:developer'; + import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; @@ -55,6 +57,7 @@ class _VideoViewState extends State { ///We use the [Selector] widget to rebuild the widget when the peer track node changes return Selector>( builder: (_, data, __) { + log("gettextureId Creating HMSVideoView with peerId: ${context.read().peer.name}"); ///If the peer track node is null or the peer is muted or the peer is offscreen ///We render the avatar if ((data.item1 == null) || data.item2) { @@ -81,6 +84,7 @@ class _VideoViewState extends State { // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. child: HMSVideoView( + addTrackByDefault: !context.read().isOffscreen, key: Key(data.item1!.trackId), scaleType: widget.scaleType, track: data.item1!, @@ -91,7 +95,7 @@ class _VideoViewState extends State { ), ) : ClipRRect( - clipBehavior: Clip.none, + clipBehavior: Clip.none, borderRadius: const BorderRadius.all( Radius.circular(10), ), @@ -99,6 +103,7 @@ class _VideoViewState extends State { // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. child: HMSVideoView( + addTrackByDefault: !context.read().isOffscreen, key: Key(data.item1!.trackId), scaleType: ScaleType.SCALE_ASPECT_FILL, track: data.item1!, @@ -110,8 +115,7 @@ class _VideoViewState extends State { ); } }, - selector: (_, peerTrackNode) => Tuple2( - peerTrackNode.track, - (peerTrackNode.track?.isMute ?? true))); + selector: (_, peerTrackNode) => + Tuple2(peerTrackNode.track, (peerTrackNode.track?.isMute ?? true))); } } diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart index d55f8f7bc..1d17f942b 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart @@ -14,6 +14,7 @@ class _TextureViewGridState extends State { @override Widget build(BuildContext context) { return GridView.builder( + cacheExtent: 400, scrollDirection: Axis.horizontal, physics: const PageScrollPhysics(), gridDelegate: diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 69cca8e82..4d89bf225 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -612,6 +612,7 @@ class HmssdkFlutterPlugin : private fun createTextureView(call: MethodCall, result: Result){ val trackId = call.argument("track_id") + val addTrackByDefault = call.argument("add_track_by_def")?:false trackId?.let { if(renderers.containsKey(it)){ val renderer = renderers[it] @@ -630,6 +631,10 @@ class HmssdkFlutterPlugin : entry?.let { surfaceTextureEntry -> val surfaceTexture = surfaceTextureEntry.surfaceTexture() val renderer = HMSTextureView(surfaceTexture,videoTrack,entry) + if(addTrackByDefault){ + Log.i("HMSTextureView","Init Add Track called for track: ${track.trackId}") + renderer.addTrack() + } renderers["$trackId"] = renderer // val eventChannel = EventChannel( // hmsBinaryMessenger, diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 25cde3ee8..25a1e7f60 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -20,8 +20,8 @@ class HMSTextureView( var uid: Long? = null init { hmsTextureRenderer = HMSTextureRenderer(texture) - Log.i("HMSTextureView","creating texture view $entry $hmsTextureRenderer") - addTrack() + Log.i("HMSTextureView","creating texture view track: ${track.trackId}") +// addTrack() uid = entry?.id() } @@ -36,7 +36,7 @@ class HMSTextureView( } fun disposeTextureView(){ - Log.i("HMSTextureView","disposeTextureView $entry $hmsTextureRenderer") + Log.i("HMSTextureView","disposeTextureView track: ${track.trackId}") hmsTextureRenderer?.removeTrack() entry?.release() entry = null diff --git a/packages/hmssdk_flutter/lib/src/hmssdk.dart b/packages/hmssdk_flutter/lib/src/hmssdk.dart index cd8fadf97..c19f2057b 100644 --- a/packages/hmssdk_flutter/lib/src/hmssdk.dart +++ b/packages/hmssdk_flutter/lib/src/hmssdk.dart @@ -1474,16 +1474,16 @@ class HMSSDK { } } - void addTrack({required HMSVideoTrack track}){ - PlatformService.invokeMethod( + void addTrack({required HMSVideoTrack track}) async{ + await PlatformService.invokeMethod( PlatformMethod.addTrack, arguments: { "track_id":track.trackId, }); } - void removeTrack({required HMSVideoTrack track}){ - PlatformService.invokeMethod( + void removeTrack({required HMSVideoTrack track}) async{ + await PlatformService.invokeMethod( PlatformMethod.removeTrack, arguments: { "track_id": track.trackId, diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index 794645e6e..b2659ecbe 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -55,6 +55,8 @@ class HMSVideoView extends StatelessWidget { /// [disableAutoSimulcastLayerSelect] - To disable auto simulcast (Adaptive Bitrate) final bool disableAutoSimulcastLayerSelect; + final bool addTrackByDefault; + ///100ms HMSVideoView /// ///HMSVideoView used to render video in ios and android devices @@ -89,7 +91,8 @@ class HMSVideoView extends StatelessWidget { "matchParent is not longer necessary and will be removed in future version") this.matchParent = true, this.scaleType = ScaleType.SCALE_ASPECT_FIT, - this.disableAutoSimulcastLayerSelect = false}) + this.disableAutoSimulcastLayerSelect = false, + this.addTrackByDefault = true}) : super(key: key); @override @@ -100,6 +103,7 @@ class HMSVideoView extends StatelessWidget { setMirror: setMirror, scaleType: this.scaleType, disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect, + addTrackByDefault: addTrackByDefault, ); } } @@ -110,6 +114,7 @@ class _PlatformView extends StatefulWidget { final bool matchParent; final ScaleType scaleType; final bool disableAutoSimulcastLayerSelect; + final bool addTrackByDefault; _PlatformView( {Key? key, @@ -117,7 +122,8 @@ class _PlatformView extends StatefulWidget { this.setMirror = false, this.matchParent = true, required this.scaleType, - this.disableAutoSimulcastLayerSelect = false}) + this.disableAutoSimulcastLayerSelect = false, + this.addTrackByDefault = true}) : super(key: key); @override @@ -145,12 +151,13 @@ class _PlatformViewState extends State<_PlatformView> { log("getTextureId 1 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); var result = await PlatformService.invokeMethod( PlatformMethod.createTextureView, - arguments: {"track_id": widget.track.trackId}); + arguments: {"track_id": widget.track.trackId, + "add_track_by_def":widget.addTrackByDefault}); if (result["success"] && mounted) { setState(() { textureId = result["data"]["texture_id"]; }); - log("getTextureId 2 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); + log("getTextureId 2 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); } } @@ -172,7 +179,11 @@ class _PlatformViewState extends State<_PlatformView> { Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return textureId == null ? Container(color: Colors.red,) : Texture(textureId: textureId!); + return textureId == null + ? Container( + color: Colors.red, + ) + : Texture(textureId: textureId!); // /Texture(textureId: textureId); // get textureId fom video view // return AndroidView( From 834fc2e7aa00546a85a0978337fde1e035ad4b3c Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 25 Oct 2023 16:38:51 +0530 Subject: [PATCH 10/53] Added pooling for prebuilt --- .../lib/src/hmssdk_interactor.dart | 8 - .../lib/src/meeting/meeting_store.dart | 24 +-- .../lib/src/model/peer_track_node.dart | 2 +- .../src/widgets/common_widgets/peer_tile.dart | 28 ++-- .../widgets/common_widgets/video_view.dart | 8 +- .../grid_layouts/listenable_peer_widget.dart | 13 +- .../grid_layouts/texture_view_grid.dart | 8 +- packages/hmssdk_flutter/android/build.gradle | 1 - .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 142 +++++++++++------- .../hmssdk_flutter/views/HMSTextureView.kt | 13 +- .../hmssdk_flutter/lib/hmssdk_flutter.dart | 1 + packages/hmssdk_flutter/lib/src/hmssdk.dart | 16 -- .../lib/src/ui/meeting/hms_video_view.dart | 61 +++----- .../ui/meeting/hms_video_view_controller.dart | 55 +++++++ 14 files changed, 228 insertions(+), 152 deletions(-) create mode 100644 packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart diff --git a/packages/hms_room_kit/lib/src/hmssdk_interactor.dart b/packages/hms_room_kit/lib/src/hmssdk_interactor.dart index 67087217f..558007313 100644 --- a/packages/hms_room_kit/lib/src/hmssdk_interactor.dart +++ b/packages/hms_room_kit/lib/src/hmssdk_interactor.dart @@ -413,12 +413,4 @@ class HMSSDKInteractor { hmsSDK.lowerRemotePeerHand( forPeer: forPeer, hmsActionResultListener: hmsActionResultListener); } - - void addTrack({required HMSVideoTrack track}) { - hmsSDK.addTrack(track: track); - } - - void removeTrack({required HMSVideoTrack track}) { - hmsSDK.removeTrack(track: track); - } } diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 1295ba288..76cd2ddcb 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -231,6 +231,9 @@ class MeetingStore extends ChangeNotifier ///Check whether recording is in intialising state bool isRecordingInInitialisingState = false; + ///Pool of video views + List viewControllers = []; + Future join(String userName, String roomCode, {HMSConfig? roomConfig}) async { //If roomConfig is null then only we call the methods to get the authToken @@ -829,7 +832,7 @@ class MeetingStore extends ChangeNotifier getCurrentAudioDevice(); getAudioDevicesList(); notifyListeners(); - + setViewControllers(); // if (Platform.isIOS && // HMSRoomLayout.roleLayoutData?.screens?.conferencing?.defaultConf != // null) { @@ -842,6 +845,12 @@ class MeetingStore extends ChangeNotifier // } } + void setViewControllers() { + for (var i = 0; i < 6; i++) { + viewControllers.add(HMSVideoViewController(addTrackByDefault: false)); + } + } + void setParticipantsList(List roles) { String? onStageRoles = HMSRoomLayout.roleLayoutData?.screens?.conferencing ?.defaultConf?.elements?.onStageExp?.onStageRole; @@ -1269,6 +1278,11 @@ class MeetingStore extends ChangeNotifier isRoomEnded = true; resetForegroundTaskAndOrientation(); + viewControllers.forEach((element) { + element.disposeTextureView(); + }); + viewControllers.clear(); + ///Here we call the method passed by the user in HMSPrebuilt as a callback if (Constant.onLeave != null) { Constant.onLeave!(); @@ -1823,14 +1837,6 @@ class MeetingStore extends ChangeNotifier } } - void addTrack({required HMSVideoTrack track}) { - _hmsSDKInteractor.addTrack(track: track); - } - - void removeTrack({required HMSVideoTrack track}) { - _hmsSDKInteractor.removeTrack(track: track); - } - HMSAudioFilePlayerNode audioFilePlayerNode = HMSAudioFilePlayerNode("audioFilePlayerNode"); HMSMicNode micNode = HMSMicNode(); diff --git a/packages/hms_room_kit/lib/src/model/peer_track_node.dart b/packages/hms_room_kit/lib/src/model/peer_track_node.dart index d891615e8..826c10a01 100644 --- a/packages/hms_room_kit/lib/src/model/peer_track_node.dart +++ b/packages/hms_room_kit/lib/src/model/peer_track_node.dart @@ -14,7 +14,7 @@ class PeerTrackNode extends ChangeNotifier { RTCStats? stats; int audioLevel; bool pinTile; - bool isOffscreen = false; + bool isOffscreen = true; PeerTrackNode( {required this.peer, diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index 157a51afb..e3ecd6d0a 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -37,13 +37,15 @@ class PeerTile extends StatefulWidget { final double avatarRadius; final double avatarTitleFontSize; final double avatarTitleTextLineHeight; + final HMSVideoViewController? videoViewController; const PeerTile( {Key? key, this.scaleType = ScaleType.SCALE_ASPECT_FILL, this.islongPressEnabled = true, this.avatarRadius = 34, this.avatarTitleFontSize = 34, - this.avatarTitleTextLineHeight = 40}) + this.avatarTitleTextLineHeight = 40, + this.videoViewController}) : super(key: key); @override @@ -64,10 +66,8 @@ class _PeerTileState extends State { Provider.of(context, listen: false) .setOffScreenStatus(true); if (context.read().track != null) { - context - .read() - .removeTrack(track: context.read().track!); - log("getTextureId Track Removed for peer: ${context.read().peer.name}"); + log("HMSVideoViewController remove video track ${context.read().peer.name}"); + widget.videoViewController?.removeTrack(); } } }, @@ -75,11 +75,10 @@ class _PeerTileState extends State { Provider.of(context, listen: false) .setOffScreenStatus(false); if (context.read().track != null) { - context - .read() - .addTrack(track: context.read().track!); + log("HMSVideoViewController add video track ${context.read().peer.name}"); + widget.videoViewController + ?.addTrack(track: context.read().track!); } - log("getTextureId Track Added for peer: ${context.read().peer.name}"); }, child: LayoutBuilder(builder: (context, BoxConstraints constraints) { return context.read().uid.contains("mainVideo") @@ -101,12 +100,13 @@ class _PeerTileState extends State { avatarRadius: widget.avatarRadius, avatarTitleTextLineHeight: widget.avatarTitleTextLineHeight, + videoViewController: widget.videoViewController, ), - Semantics( - label: - "fl_${context.read().peer.name}_degraded_tile", - child: const DegradeTile(), - ), + // Semantics( + // label: + // "fl_${context.read().peer.name}_degraded_tile", + // child: const DegradeTile(), + // ), Selector( selector: (_, peerTrackNode) => peerTrackNode.isOffscreen, diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index f2a62a095..e075f539e 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -35,6 +35,8 @@ class VideoView extends StatefulWidget { final double avatarRadius; final double avatarTitleFontSize; final double avatarTitleTextLineHeight; + final HMSVideoViewController? videoViewController; + const VideoView( {Key? key, this.viewSize, @@ -44,7 +46,8 @@ class VideoView extends StatefulWidget { this.scaleType = ScaleType.SCALE_ASPECT_FILL, this.avatarRadius = 34, this.avatarTitleFontSize = 34, - this.avatarTitleTextLineHeight = 32}) + this.avatarTitleTextLineHeight = 32, + this.videoViewController}) : super(key: key); @override @@ -57,7 +60,6 @@ class _VideoViewState extends State { ///We use the [Selector] widget to rebuild the widget when the peer track node changes return Selector>( builder: (_, data, __) { - log("gettextureId Creating HMSVideoView with peerId: ${context.read().peer.name}"); ///If the peer track node is null or the peer is muted or the peer is offscreen ///We render the avatar if ((data.item1 == null) || data.item2) { @@ -84,6 +86,7 @@ class _VideoViewState extends State { // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. child: HMSVideoView( + controller: widget.videoViewController, addTrackByDefault: !context.read().isOffscreen, key: Key(data.item1!.trackId), scaleType: widget.scaleType, @@ -103,6 +106,7 @@ class _VideoViewState extends State { // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. child: HMSVideoView( + controller: widget.videoViewController, addTrackByDefault: !context.read().isOffscreen, key: Key(data.item1!.trackId), scaleType: ScaleType.SCALE_ASPECT_FILL, diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart index 557f4a512..c3145efce 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart @@ -1,5 +1,6 @@ ///Package imports import 'package:flutter/cupertino.dart'; +import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:provider/provider.dart'; ///Project imports @@ -24,9 +25,15 @@ class ListenablePeerWidget extends StatelessWidget { return ChangeNotifierProvider.value( key: ValueKey("${peerTracks[index].uid}video_view"), value: peerTracks[index], - child: PeerTile( - key: ValueKey("${peerTracks[index].uid}audio_view"), - scaleType: scaleType, + child: Selector( + selector: (_,meetingStore) => meetingStore.viewControllers[index%6], + builder: (_,viewController,__) { + return PeerTile( + videoViewController: viewController, + key: ValueKey("${peerTracks[index].uid}audio_view"), + scaleType: scaleType, + ); + } )); } } diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart index 1d17f942b..70bed37e5 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart @@ -1,6 +1,8 @@ import 'package:flutter/cupertino.dart'; +import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:hms_room_kit/src/model/peer_track_node.dart'; import 'package:hms_room_kit/src/widgets/grid_layouts/listenable_peer_widget.dart'; +import 'package:provider/provider.dart'; class TextureViewGrid extends StatefulWidget { final List peerTracks; @@ -14,11 +16,11 @@ class _TextureViewGridState extends State { @override Widget build(BuildContext context) { return GridView.builder( - cacheExtent: 400, scrollDirection: Axis.horizontal, physics: const PageScrollPhysics(), - gridDelegate: - SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 3,mainAxisExtent: MediaQuery.of(context).size.width/2), + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 3, + mainAxisExtent: MediaQuery.of(context).size.width / 2), itemCount: widget.peerTracks.length, itemBuilder: (context, index) { return ListenablePeerWidget( diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 00e7d836d..e8637eafb 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -49,7 +49,6 @@ dependencies { implementation "com.github.100mslive.android-sdk:hls-player:feature~custom-texture-imp-SNAPSHOT" implementation 'com.github.100mslive.android-sdk:lib:feature~custom-texture-imp-SNAPSHOT' -// implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 4d89bf225..70e3e6974 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -613,29 +613,41 @@ class HmssdkFlutterPlugin : val trackId = call.argument("track_id") val addTrackByDefault = call.argument("add_track_by_def")?:false - trackId?.let { - if(renderers.containsKey(it)){ - val renderer = renderers[it] - renderer?.addTrack() - val data = HashMap() - data["texture_id"] = renderer?.uid!! - result.success(HMSResultExtension.toDictionary(true,data)) - return - } - val room = hmssdk?.getRoom() - - room?.let { currentRoom -> - val track = HmsUtilities.getVideoTrack(it,currentRoom) - track?.let { videoTrack -> - val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() - entry?.let { surfaceTextureEntry -> - val surfaceTexture = surfaceTextureEntry.surfaceTexture() - val renderer = HMSTextureView(surfaceTexture,videoTrack,entry) - if(addTrackByDefault){ + + val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() + entry?.let { surfaceTextureEntry -> + val surfaceTexture = surfaceTextureEntry.surfaceTexture() + val renderer = HMSTextureView(surfaceTexture,entry) + if(addTrackByDefault){ + val room = hmssdk?.getRoom() + room?.let { currentRoom -> + trackId?.let {currentTrackId -> + val track = HmsUtilities.getVideoTrack(currentTrackId,currentRoom) + track?.let { videoTrack -> Log.i("HMSTextureView","Init Add Track called for track: ${track.trackId}") - renderer.addTrack() + renderer.addTrack(videoTrack) + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","No track with $trackId found","Track not found error",result) + return } - renderers["$trackId"] = renderer + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","trackId is null"," NULL ERROR",result) + return + } + }?: run { + HMSErrorLogger.returnHMSException("createTextureView","Room is null","NULL Error",result) + return + } + } + renderers["${surfaceTextureEntry.id()}"] = renderer + val data = HashMap() + data["texture_id"] = surfaceTextureEntry.id() + result.success(HMSResultExtension.toDictionary(true,data)) + + }?:run{ + HMSErrorLogger.returnHMSException("createTextureView","entry is null","NULL Error",result) + return + } // val eventChannel = EventChannel( // hmsBinaryMessenger, // "HMSTextureView/Texture" + entry.id() @@ -643,39 +655,18 @@ class HmssdkFlutterPlugin : // eventChannel.setStreamHandler(renderer) // renderer.setTextureViewEventChannel(eventChannel) - val data = HashMap() - data["texture_id"] = surfaceTextureEntry.id() - result.success(HMSResultExtension.toDictionary(true,data)) - return - }?: run { - HMSErrorLogger.returnHMSException("createTextureView","SurfaceTextureEntry is null","NULL ERROR",result) - } - }?: run { - HMSErrorLogger.returnHMSException("createTextureView","No track with $trackId found","Track not found error",result) - } - }?: run { - HMSErrorLogger.returnHMSException("createTextureView","room is null","NULL ERROR",result) - } - } ?: run { - HMSErrorLogger.returnHMSException( - "createTextureView", - "trackId is null", - "NULL ERROR", - result - ) - } } private fun disposeTextureView(call: MethodCall,result: Result){ - val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") + val textureId = call.argument("texture_id") ?: HMSErrorLogger.returnArgumentsError("textureId is null") - var renderer = renderers["$trackId"] + var renderer = renderers["$textureId"] if(renderer != null){ renderer.disposeTextureView() renderer = null - renderers.remove("$trackId") + renderers.remove("$textureId") result.success(HMSResultExtension.toDictionary(true,null)) } else { @@ -689,16 +680,65 @@ class HmssdkFlutterPlugin : } private fun addTrack(call: MethodCall, result: Result){ - val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") - val renderer = renderers["$trackId"] - renderer?.addTrack() - result.success(null) + val trackId = call.argument("track_id") + val textureId = call.argument("texture_id") + + textureId?.let {texture -> + trackId?.let { + val renderer = renderers["$textureId"] + renderer?.let { textureRenderer -> + val room = hmssdk?.getRoom() + room?.let { currentRoom -> + val track = HmsUtilities.getVideoTrack(trackId,currentRoom) + track?.let {videoTrack -> + textureRenderer.addTrack(videoTrack) + result.success(null) + }?: run { + HMSErrorLogger.returnHMSException( + "addTrack", + "track with given trackId not found", + "Track not found error", + result + ) + } + }?: run { + HMSErrorLogger.returnHMSException( + "addTrack", + "room not found", + "room not found error", + result + ) + } + }?: run { + HMSErrorLogger.returnHMSException( + "addTrack", + "renderer with given $texture not found", + "renderer not found error", + result + ) + } + }?: run { + HMSErrorLogger.returnHMSException( + "addTrack", + "trackId is null", + "NULL ERROR", + result + ) + } + }?:run { + HMSErrorLogger.returnHMSException( + "addTrack", + "textureId is null", + "NULL ERROR", + result + ) + } } private fun removeTrack(call: MethodCall, result: Result){ - val trackId = call.argument("track_id") ?: HMSErrorLogger.returnArgumentsError("trackId is null") + val textureId = call.argument("texture_id") - val renderer = renderers["$trackId"] + val renderer = renderers["$textureId"] renderer?.removeTrack() result.success(null) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 25a1e7f60..3b0bd0c77 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -10,34 +10,31 @@ import live.hms.videoview.textureview.HMSTextureRenderer class HMSTextureView( texture: SurfaceTexture, - val track: HMSVideoTrack, var entry: TextureRegistry.SurfaceTextureEntry? ){ // var eventChannel: EventChannel? = null // var eventSink: EventSink? = null - var hmsTextureRenderer: HMSTextureRenderer? = null + private var hmsTextureRenderer: HMSTextureRenderer? = null var uid: Long? = null init { hmsTextureRenderer = HMSTextureRenderer(texture) - Log.i("HMSTextureView","creating texture view track: ${track.trackId}") -// addTrack() uid = entry?.id() } - fun addTrack(){ + fun addTrack(track: HMSVideoTrack){ Log.i("HMSTextureView","Add Track called for track: ${track.trackId}") hmsTextureRenderer?.addTrack(track) } fun removeTrack(){ - Log.i("HMSTextureView","Remove Track called for track: ${track.trackId}") + Log.i("HMSTextureView","Remove Track called") hmsTextureRenderer?.removeTrack() } fun disposeTextureView(){ - Log.i("HMSTextureView","disposeTextureView track: ${track.trackId}") - hmsTextureRenderer?.removeTrack() + Log.i("HMSTextureView","disposeTextureView called") + removeTrack() entry?.release() entry = null hmsTextureRenderer = null diff --git a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart index a2ed8ad45..e564b4a33 100644 --- a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart +++ b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart @@ -104,3 +104,4 @@ export 'src/model/peer_list_iterator_options.dart'; //Views export 'src/ui/meeting/hms_video_view.dart'; export 'src/ui/meeting/hms_hls_player.dart'; +export 'src/ui/meeting/hms_video_view_controller.dart'; diff --git a/packages/hmssdk_flutter/lib/src/hmssdk.dart b/packages/hmssdk_flutter/lib/src/hmssdk.dart index c19f2057b..fe28339d6 100644 --- a/packages/hmssdk_flutter/lib/src/hmssdk.dart +++ b/packages/hmssdk_flutter/lib/src/hmssdk.dart @@ -1474,22 +1474,6 @@ class HMSSDK { } } - void addTrack({required HMSVideoTrack track}) async{ - await PlatformService.invokeMethod( - PlatformMethod.addTrack, - arguments: { - "track_id":track.trackId, - }); - } - - void removeTrack({required HMSVideoTrack track}) async{ - await PlatformService.invokeMethod( - PlatformMethod.removeTrack, - arguments: { - "track_id": track.trackId, - }); - } - /// To modify local peer's audio & video tracks settings use the [hmsTrackSetting]. Only required for advanced use cases. HMSTrackSetting? hmsTrackSetting; diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index b2659ecbe..45124ac2a 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -8,7 +8,7 @@ import 'package:flutter/services.dart' show StandardMessageCodec; // Project imports: import 'package:hmssdk_flutter/hmssdk_flutter.dart'; -import 'package:hmssdk_flutter/src/service/platform_service.dart'; +import 'package:hmssdk_flutter/src/ui/meeting/hms_video_view_controller.dart'; ///100ms HMSVideoView /// @@ -57,6 +57,8 @@ class HMSVideoView extends StatelessWidget { final bool addTrackByDefault; + final HMSVideoViewController? controller; + ///100ms HMSVideoView /// ///HMSVideoView used to render video in ios and android devices @@ -92,7 +94,8 @@ class HMSVideoView extends StatelessWidget { this.matchParent = true, this.scaleType = ScaleType.SCALE_ASPECT_FIT, this.disableAutoSimulcastLayerSelect = false, - this.addTrackByDefault = true}) + this.addTrackByDefault = true, + this.controller}) : super(key: key); @override @@ -104,6 +107,7 @@ class HMSVideoView extends StatelessWidget { scaleType: this.scaleType, disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect, addTrackByDefault: addTrackByDefault, + controller: controller, ); } } @@ -115,6 +119,7 @@ class _PlatformView extends StatefulWidget { final ScaleType scaleType; final bool disableAutoSimulcastLayerSelect; final bool addTrackByDefault; + final HMSVideoViewController? controller; _PlatformView( {Key? key, @@ -123,7 +128,8 @@ class _PlatformView extends StatefulWidget { this.matchParent = true, required this.scaleType, this.disableAutoSimulcastLayerSelect = false, - this.addTrackByDefault = true}) + this.addTrackByDefault = true, + this.controller}) : super(key: key); @override @@ -131,59 +137,42 @@ class _PlatformView extends StatefulWidget { } class _PlatformViewState extends State<_PlatformView> { - int? textureId; + HMSVideoViewController? viewController; void onPlatformViewCreated(int id) {} @override void initState() { + if (widget.controller == null) { + viewController = HMSVideoViewController( + track: widget.track as HMSVideoTrack, callback: setView); + } else { + viewController = widget.controller; + } super.initState(); - getTextureId(); - } - - @override - void dispose() { - disposeTextureView(); - super.dispose(); } - void getTextureId() async { - log("getTextureId 1 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); - var result = await PlatformService.invokeMethod( - PlatformMethod.createTextureView, - arguments: {"track_id": widget.track.trackId, - "add_track_by_def":widget.addTrackByDefault}); - if (result["success"] && mounted) { - setState(() { - textureId = result["data"]["texture_id"]; - }); - log("getTextureId 2 called timestamp: ${DateTime.now().millisecondsSinceEpoch}}"); + void setView() { + if (mounted) { + setState(() {}); } } - void disposeTextureView() async { - var result = await PlatformService.invokeMethod( - PlatformMethod.disposeTextureView, - arguments: { - "track_id": widget.track.trackId, - "texture_id": textureId.toString() - }); - if (result["success"] && mounted) { - setState(() { - textureId = null; - }); - } + @override + void dispose() { + // viewController?.disposeTextureView(callback: setView); + super.dispose(); } @override Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return textureId == null + return viewController?.textureId == null ? Container( color: Colors.red, ) - : Texture(textureId: textureId!); + : Texture(textureId: viewController!.textureId!); // /Texture(textureId: textureId); // get textureId fom video view // return AndroidView( diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart new file mode 100644 index 000000000..1347e640f --- /dev/null +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart @@ -0,0 +1,55 @@ +import 'dart:developer'; + +import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +import 'package:hmssdk_flutter/src/service/platform_service.dart'; + +class HMSVideoViewController { + int? textureId; + + HMSVideoViewController( + {HMSVideoTrack? track, bool addTrackByDefault = true,Function? callback}) { + createTextureView(track, addTrackByDefault,callback); + } + + void createTextureView(HMSTrack? track, bool addTrackByDefault, Function? callback) async { + log("HMSVideoViewController createTextureView called"); + var result = await PlatformService.invokeMethod( + PlatformMethod.createTextureView, + arguments: { + "track_id": track?.trackId, + "add_track_by_def": addTrackByDefault + }); + if (result["success"]) { + textureId = result["data"]["texture_id"]; + if(callback != null){ + callback(); + } + } + } + + void disposeTextureView({ Function? callback}) async { + log("HMSVideoViewController dispose video track"); + var result = await PlatformService.invokeMethod( + PlatformMethod.disposeTextureView, + arguments: {"texture_id": textureId.toString()}); + if (result["success"]) { + textureId = null; + if(callback != null){ + callback(); + } + } + } + + void addTrack({required HMSVideoTrack track}) async { + await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { + "track_id": track.trackId, + "texture_id":textureId.toString() + }); + } + + void removeTrack() async { + await PlatformService.invokeMethod(PlatformMethod.removeTrack, arguments: { + "texture_id":textureId.toString() + }); + } +} From c73266d94488feaa122c7d088c56366c7d83743e Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 26 Oct 2023 16:51:56 +0530 Subject: [PATCH 11/53] =?UTF-8?q?released=20sample=20app=20version=201.5.7?= =?UTF-8?q?8=20(378)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/src/meeting/meeting_store.dart | 4 +- .../widgets/common_widgets/degrade_tile.dart | 74 ++++++--------- .../src/widgets/common_widgets/peer_tile.dart | 23 ++--- .../widgets/common_widgets/video_view.dart | 61 +++++------- .../grid_layouts/listenable_peer_widget.dart | 20 ++-- .../grid_layouts/texture_view_grid.dart | 2 - .../meeting_modes/custom_grid_view.dart | 1 - .../meeting_modes/custom_one_to_one_grid.dart | 95 ++++++++++--------- .../src/widgets/peer_widgets/peer_name.dart | 18 ++-- .../chat_participants_tab_bar.dart | 2 +- .../example/android/app/build.gradle | 4 +- .../example/ios/Runner/Info.plist | 4 +- .../lib/src/ui/meeting/hms_video_view.dart | 33 +++++-- 13 files changed, 168 insertions(+), 173 deletions(-) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 76cd2ddcb..057e8b957 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1278,9 +1278,9 @@ class MeetingStore extends ChangeNotifier isRoomEnded = true; resetForegroundTaskAndOrientation(); - viewControllers.forEach((element) { + for (var element in viewControllers) { element.disposeTextureView(); - }); + } viewControllers.clear(); ///Here we call the method passed by the user in HMSPrebuilt as a callback diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart index dc7b2c32a..750f726f3 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/degrade_tile.dart @@ -1,6 +1,3 @@ -///Dart imports -import 'dart:ui'; - ///Package imports import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -16,64 +13,51 @@ import 'package:hms_room_kit/src/widgets/common_widgets/hms_subtitle_text.dart'; ///when the connection is poor ///The tile is shown when the track is degraded ///The tile is hidden when the track is not degraded -class DegradeTile extends StatefulWidget { - const DegradeTile({Key? key}) : super(key: key); - - @override - State createState() => _DegradeTileState(); -} +class DegradeTile extends StatelessWidget { + final BoxConstraints constraints; + const DegradeTile({Key? key, required this.constraints}) : super(key: key); -class _DegradeTileState extends State { @override Widget build(BuildContext context) { return Selector( builder: (_, data, __) { - return Visibility( - visible: data, - child: - LayoutBuilder(builder: (context, BoxConstraints constraints) { - return Container( + return data + ? Container( decoration: const BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10))), child: Stack( children: [ - ClipRRect( - ///Here we are using a backdrop filter to blur the background - ///when the connection is poor - child: Container( - color: Colors.black.withOpacity(0.5), + Container( + color: Colors.black.withOpacity(0.5), + alignment: Alignment.center, + child: Align( alignment: Alignment.center, - child: Align( - alignment: Alignment.center, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - HMSSubheadingText( - text: "Poor connection", - textColor: - HMSThemeColors.onSurfaceHighEmphasis, - fontWeight: FontWeight.w600, - letterSpacing: 0.1, - ), - const SizedBox( - height: 4, - ), - HMSSubtitleText( - text: - "The video will resume\n automatically when the\n connection improves", - textColor: - HMSThemeColors.onSurfaceHighEmphasis, - ) - ], - ), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + HMSSubheadingText( + text: "Poor connection", + textColor: HMSThemeColors.onSurfaceHighEmphasis, + fontWeight: FontWeight.w600, + letterSpacing: 0.1, + ), + const SizedBox( + height: 4, + ), + HMSSubtitleText( + text: + "The video will resume\n automatically when the\n connection improves", + textColor: HMSThemeColors.onSurfaceHighEmphasis, + ) + ], ), ), ), NameAndNetwork(maxWidth: constraints.maxWidth), ], ), - ); - })); + ) + : const SizedBox(); }, selector: (_, peerTrackNode) => peerTrackNode.track?.isDegraded ?? false); diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index e3ecd6d0a..5aa6fc211 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -66,8 +66,10 @@ class _PeerTileState extends State { Provider.of(context, listen: false) .setOffScreenStatus(true); if (context.read().track != null) { - log("HMSVideoViewController remove video track ${context.read().peer.name}"); - widget.videoViewController?.removeTrack(); + // log("HMSVideoViewController remove video track ${context.read().peer.name}"); + + ///Avoiding remove track + // widget.videoViewController?.removeTrack(); } } }, @@ -85,7 +87,6 @@ class _PeerTileState extends State { ? Container( key: key, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), color: HMSThemeColors.backgroundDefault, ), child: Semantics( @@ -102,11 +103,13 @@ class _PeerTileState extends State { widget.avatarTitleTextLineHeight, videoViewController: widget.videoViewController, ), - // Semantics( - // label: - // "fl_${context.read().peer.name}_degraded_tile", - // child: const DegradeTile(), - // ), + Semantics( + label: + "fl_${context.read().peer.name}_degraded_tile", + child: DegradeTile( + constraints: constraints, + ), + ), Selector( selector: (_, peerTrackNode) => peerTrackNode.isOffscreen, @@ -116,8 +119,6 @@ class _PeerTileState extends State { label: "fl_video_off", child: Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.circular(10), color: HMSThemeColors.backgroundDefault, ), @@ -129,7 +130,7 @@ class _PeerTileState extends State { widget.avatarTitleTextLineHeight, ), )) - : Container(); + : const SizedBox(); }), NameAndNetwork(maxWidth: constraints.maxWidth), const HandRaise(), //top left diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index e075f539e..fe3b414ae 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -1,6 +1,4 @@ //Package imports -import 'dart:developer'; - import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; @@ -80,41 +78,34 @@ class _VideoViewState extends State { ///If the video track source is REGULAR i.e. it is a camera video track ///we set the scaletype as FILL return (data.item1?.source != "REGULAR") - ? ClipRRect( - borderRadius: const BorderRadius.all(Radius.circular(10)), - child: InteractiveViewer( - // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. - // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. - child: HMSVideoView( - controller: widget.videoViewController, - addTrackByDefault: !context.read().isOffscreen, - key: Key(data.item1!.trackId), - scaleType: widget.scaleType, - track: data.item1!, - setMirror: false, - disableAutoSimulcastLayerSelect: - !(context.read().isAutoSimulcast), - ), + ? InteractiveViewer( + // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. + // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. + child: HMSVideoView( + controller: widget.videoViewController, + addTrackByDefault: + !context.read().isOffscreen, + key: Key(data.item1!.trackId), + scaleType: ScaleType.SCALE_ASPECT_FIT, + track: data.item1!, + setMirror: false, + disableAutoSimulcastLayerSelect: + !(context.read().isAutoSimulcast), ), ) - : ClipRRect( - clipBehavior: Clip.none, - borderRadius: const BorderRadius.all( - Radius.circular(10), - ), - child: SizedBox( - // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. - // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. - child: HMSVideoView( - controller: widget.videoViewController, - addTrackByDefault: !context.read().isOffscreen, - key: Key(data.item1!.trackId), - scaleType: ScaleType.SCALE_ASPECT_FILL, - track: data.item1!, - setMirror: data.item1.runtimeType == HMSLocalVideoTrack, - disableAutoSimulcastLayerSelect: - !(context.read().isAutoSimulcast), - ), + : SizedBox( + // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. + // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. + child: HMSVideoView( + controller: widget.videoViewController, + addTrackByDefault: + !context.read().isOffscreen, + key: Key(data.item1!.trackId), + scaleType: ScaleType.SCALE_ASPECT_FILL, + track: data.item1!, + setMirror: data.item1.runtimeType == HMSLocalVideoTrack, + disableAutoSimulcastLayerSelect: + !(context.read().isAutoSimulcast), ), ); } diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart index c3145efce..e12730b94 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart @@ -25,15 +25,15 @@ class ListenablePeerWidget extends StatelessWidget { return ChangeNotifierProvider.value( key: ValueKey("${peerTracks[index].uid}video_view"), value: peerTracks[index], - child: Selector( - selector: (_,meetingStore) => meetingStore.viewControllers[index%6], - builder: (_,viewController,__) { - return PeerTile( - videoViewController: viewController, - key: ValueKey("${peerTracks[index].uid}audio_view"), - scaleType: scaleType, - ); - } - )); + child: Selector( + selector: (_, meetingStore) => + meetingStore.viewControllers[index % 6], + builder: (_, viewController, __) { + return PeerTile( + videoViewController: viewController, + key: ValueKey("${peerTracks[index].uid}audio_view"), + scaleType: scaleType, + ); + })); } } diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart index 70bed37e5..dae0af083 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart @@ -1,8 +1,6 @@ import 'package:flutter/cupertino.dart'; -import 'package:hms_room_kit/src/meeting/meeting_store.dart'; import 'package:hms_room_kit/src/model/peer_track_node.dart'; import 'package:hms_room_kit/src/widgets/grid_layouts/listenable_peer_widget.dart'; -import 'package:provider/provider.dart'; class TextureViewGrid extends StatefulWidget { final List peerTracks; diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart index 9d236c242..186c11295 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart @@ -37,7 +37,6 @@ class _CustomGridViewState extends State { children: [ Expanded( child: PageView.builder( - clipBehavior: Clip.none, physics: const PageScrollPhysics(), scrollDirection: Axis.horizontal, controller: controller, diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index aac0785f9..c1614b8c5 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -1,7 +1,6 @@ ///Package imports import 'package:dots_indicator/dots_indicator.dart'; import 'package:flutter/material.dart'; -import 'package:hms_room_kit/src/widgets/grid_layouts/texture_view_grid.dart'; import 'package:provider/provider.dart'; import 'package:tuple/tuple.dart'; @@ -35,11 +34,10 @@ class _CustomOneToOneGridState extends State { ///One thing to note here is that in this view we filter out the local peer since we are rendering the local peer in the inset tile ///The inset tile is rendered at the top of the grid view return Selector, int, int, PeerTrackNode, int>>( - selector: (_, meetingStore) => Tuple5( + Tuple4, int, PeerTrackNode, int>>( + selector: (_, meetingStore) => Tuple4( meetingStore.peerTracks, meetingStore.peerTracks.length, - meetingStore.currentPage, meetingStore.peerTracks[0], meetingStore.screenShareCount), builder: (_, data, __) { @@ -49,7 +47,7 @@ class _CustomOneToOneGridState extends State { ///If the remote peer is sharing screen then we render the [ScreenshareGridLayout] with inset tile ///Else we render the normal layout with inset tile - return data.item5 > 0 + return data.item4 > 0 ? ScreenshareGridLayout( peerTracks: widget.isLocalInsetPresent ? data.item1 @@ -58,7 +56,7 @@ class _CustomOneToOneGridState extends State { element.track?.source == "SCREEN") .toList() : data.item1, - screenshareCount: data.item5, + screenshareCount: data.item4, ) : @@ -66,40 +64,39 @@ class _CustomOneToOneGridState extends State { Column( children: [ Expanded( - child: TextureViewGrid( - peerTracks: widget.isLocalInsetPresent - ? data.item1 - .where((element) => - !(element.peer.isLocal) || - element.track?.source == "SCREEN") - .toList() - : data.item1), - // child: PageView.builder( - // physics: const PageScrollPhysics(), - // controller: controller, - // allowImplicitScrolling: true, - // itemCount: pageCount, - // onPageChanged: (newPage) { - // context - // .read() - // .setCurrentPage(newPage); - // }, - // itemBuilder: (context, index) => GridLayout( - // numberOfTiles: numberOfPeers, - // index: index, + // child: TextureViewGrid( + // peerTracks: widget.isLocalInsetPresent + // ? data.item1 + // .where((element) => + // !(element.peer.isLocal) || + // element.track?.source == "SCREEN") + // .toList() + // : data.item1), + child: PageView.builder( + physics: const PageScrollPhysics(), + controller: controller, + itemCount: pageCount, + onPageChanged: (newPage) { + context + .read() + .setCurrentPage(newPage); + }, + itemBuilder: (context, index) => GridLayout( + numberOfTiles: numberOfPeers, + index: index, - // ///Here we filter out the local peer since we are rendering the local peer in the inset tile iff isLocalInsetPresent is true - // ///We only take the screenshare or remote peers - // /// - // ///If isLocalInsetPresent is false we render all the peers in grid layout - // ///Since the screenshare case is already handled above the code never reaches here - // peerTracks: widget.isLocalInsetPresent - // ? data.item1 - // .where((element) => - // !(element.peer.isLocal) || - // element.track?.source == "SCREEN") - // .toList() - // : data.item1)), + ///Here we filter out the local peer since we are rendering the local peer in the inset tile iff isLocalInsetPresent is true + ///We only take the screenshare or remote peers + /// + ///If isLocalInsetPresent is false we render all the peers in grid layout + ///Since the screenshare case is already handled above the code never reaches here + peerTracks: widget.isLocalInsetPresent + ? data.item1 + .where((element) => + !(element.peer.isLocal) || + element.track?.source == "SCREEN") + .toList() + : data.item1)), ), ///This renders the dots at the bottom of the grid view @@ -110,13 +107,19 @@ class _CustomOneToOneGridState extends State { if (pageCount > 1) Padding( padding: const EdgeInsets.only(top: 8.0), - child: DotsIndicator( - dotsCount: pageCount, - position: data.item3, - decorator: DotsDecorator( - activeColor: HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), - ), + child: Selector( + selector: (_, meetingStore) => + meetingStore.currentPage, + builder: (_, currentPage, __) { + return DotsIndicator( + dotsCount: pageCount, + position: currentPage, + decorator: DotsDecorator( + activeColor: + HMSThemeColors.onSurfaceHighEmphasis, + color: HMSThemeColors.onSurfaceLowEmphasis), + ); + }), ) ], ); diff --git a/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart b/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart index 1fd0a3bad..571d37a0b 100644 --- a/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart +++ b/packages/hms_room_kit/lib/src/widgets/peer_widgets/peer_name.dart @@ -15,16 +15,16 @@ class PeerName extends StatelessWidget { @override Widget build(BuildContext context) { - return Selector>( - selector: (_, peerTrackNode) => - Tuple2(peerTrackNode.peer.name, peerTrackNode.peer.isLocal), - builder: (_, data, __) { - return Container( - constraints: BoxConstraints(maxWidth: maxWidth - 80), - child: HMSSubheadingText( + return Container( + constraints: BoxConstraints(maxWidth: maxWidth - 80), + child: Selector>( + selector: (_, peerTrackNode) => + Tuple2(peerTrackNode.peer.name, peerTrackNode.peer.isLocal), + builder: (_, data, __) { + return HMSSubheadingText( text: "${data.item1.trim()}${data.item2 ? " (You)" : ""}", textColor: HMSThemeColors.onSurfaceHighEmphasis, - )); - }); + ); + })); } } diff --git a/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart b/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart index 3672ed008..d41b3275c 100644 --- a/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart +++ b/packages/hms_room_kit/lib/src/widgets/tab_widgets/chat_participants_tab_bar.dart @@ -47,7 +47,7 @@ class _ChatParticipantsTabBarState extends State mainAxisAlignment: MainAxisAlignment.start, children: [ Container( - width: MediaQuery.of(context).size.width * 0.78, + width: MediaQuery.of(context).size.width * 0.76, height: 36, decoration: BoxDecoration( color: HMSThemeColors.surfaceDefault, diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 382e35c22..d276d8185 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 375 - versionName "1.5.75" + versionCode 378 + versionName "1.5.78" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 208abe8c4..174319e80 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.73 + 1.5.78 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 373 + 378 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index 45124ac2a..d7151ade1 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -1,6 +1,6 @@ // Dart imports: -import 'dart:developer'; import 'dart:io' show Platform; +import 'dart:math'; // Flutter imports: import 'package:flutter/material.dart'; @@ -8,7 +8,6 @@ import 'package:flutter/services.dart' show StandardMessageCodec; // Project imports: import 'package:hmssdk_flutter/hmssdk_flutter.dart'; -import 'package:hmssdk_flutter/src/ui/meeting/hms_video_view_controller.dart'; ///100ms HMSVideoView /// @@ -160,7 +159,9 @@ class _PlatformViewState extends State<_PlatformView> { @override void dispose() { - // viewController?.disposeTextureView(callback: setView); + if(widget.controller == null){ + viewController?.disposeTextureView(callback: setView); + } super.dispose(); } @@ -169,10 +170,28 @@ class _PlatformViewState extends State<_PlatformView> { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { return viewController?.textureId == null - ? Container( - color: Colors.red, - ) - : Texture(textureId: viewController!.textureId!); + ? SizedBox() + : LayoutBuilder( + builder: (context, constraints) => Center( + child: FittedBox( + clipBehavior: Clip.hardEdge, + fit: widget.scaleType == ScaleType.SCALE_ASPECT_FIT + ? BoxFit.contain + : BoxFit.cover, + child: SizedBox( + width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT?(constraints.maxHeight * (16 / 9)):constraints.maxWidth, + height: constraints.maxHeight, + child: Center( + child: Transform( + transform: Matrix4.identity() + ..rotateY(widget.setMirror ? -pi : 0.0), + alignment: FractionalOffset.center, + child: Texture(textureId: viewController!.textureId!)), + ), + ), + ), + ), + ); // /Texture(textureId: textureId); // get textureId fom video view // return AndroidView( From 342425c17f703aea234f7fc45df7c29e0b0635ff Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Sat, 28 Oct 2023 00:29:22 +0530 Subject: [PATCH 12/53] Added active speaker --- .../lib/src/meeting/meeting_store.dart | 116 +++++++++--------- .../example/android/app/build.gradle | 4 +- .../example/ios/Runner/Info.plist | 4 +- 3 files changed, 62 insertions(+), 62 deletions(-) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 057e8b957..5cff1ec7f 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1054,68 +1054,68 @@ class MeetingStore extends ChangeNotifier @override void onUpdateSpeakers({required List updateSpeakers}) { - // //To handle the active speaker mode scenario - // if ((currentPage == 0) && - // (meetingMode == MeetingMode.activeSpeakerWithInset || - // meetingMode == MeetingMode.activeSpeakerWithoutInset) && - // peerTracks.length > 6) { - // /* Here we iterate through the updateSpeakers list - // * and do the following: - // * Find the index of the peer - // * If the peer is out of the screen when you are on first page - // * we remove the peer from that index and insert it on the first index - // */ - // for (var speaker in updateSpeakers) { - // int index = peerTracks.indexWhere((previousSpeaker) => - // previousSpeaker.uid == "${speaker.peer.peerId}mainVideo"); - // if (index > 5) { - // PeerTrackNode activeSpeaker = peerTracks[index]; - // peerTracks.removeAt(index); - // peerTracks.insert(screenShareCount, activeSpeaker); - // peerTracks[screenShareCount].setOffScreenStatus(false); - // } - // } - // notifyListeners(); - // } + //To handle the active speaker mode scenario + if ((currentPage == 0) && + (meetingMode == MeetingMode.activeSpeakerWithInset || + meetingMode == MeetingMode.activeSpeakerWithoutInset) && + peerTracks.length > 6) { + /* Here we iterate through the updateSpeakers list + * and do the following: + * Find the index of the peer + * If the peer is out of the screen when you are on first page + * we remove the peer from that index and insert it on the first index + */ + for (var speaker in updateSpeakers) { + int index = peerTracks.indexWhere((previousSpeaker) => + previousSpeaker.uid == "${speaker.peer.peerId}mainVideo"); + if (index > 5) { + PeerTrackNode activeSpeaker = peerTracks[index]; + peerTracks.removeAt(index); + peerTracks.insert(screenShareCount, activeSpeaker); + peerTracks[screenShareCount].setOffScreenStatus(false); + } + } + 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 - // if (activeSpeakerIds.isNotEmpty) { - // for (var key in activeSpeakerIds) { - // int index = peerTracks.indexWhere((element) => element.uid == key); - // if (index != -1) { - // peerTracks[index].setAudioLevel(-1); - // } - // } - // activeSpeakerIds.clear(); - // } + //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 + if (activeSpeakerIds.isNotEmpty) { + for (var key in activeSpeakerIds) { + int index = peerTracks.indexWhere((element) => element.uid == key); + if (index != -1) { + peerTracks[index].setAudioLevel(-1); + } + } + activeSpeakerIds.clear(); + } - // //Setting the border for peers who are speaking - // for (var element in updateSpeakers) { - // activeSpeakerIds.add("${element.peer.peerId}mainVideo"); - // int index = peerTracks - // .indexWhere((element) => element.uid == activeSpeakerIds.last); - // if (index != -1) { - // peerTracks[index].setAudioLevel(element.audioLevel); + //Setting the border for peers who are speaking + for (var element in updateSpeakers) { + activeSpeakerIds.add("${element.peer.peerId}mainVideo"); + int index = peerTracks + .indexWhere((element) => element.uid == activeSpeakerIds.last); + if (index != -1) { + peerTracks[index].setAudioLevel(element.audioLevel); + } + } + + // Below code for change track and text in PIP mode iOS and android. + // if (updateSpeakers.isNotEmpty) { + // if (Platform.isIOS && (screenShareCount == 0 || isScreenShareOn)) { + // if (updateSpeakers[0].peer.videoTrack != null) { + // changePIPWindowTrackOnIOS( + // track: updateSpeakers[0].peer.videoTrack, + // alternativeText: updateSpeakers[0].peer.name, + // ratio: [9, 16]); + // } else { + // changePIPWindowTextOnIOS( + // text: updateSpeakers[0].peer.name, ratio: [9, 16]); + // } + // } else if (Platform.isAndroid) { + // changePIPWindowOnAndroid("${updateSpeakers[0].peer.peerId}mainVideo"); // } // } - - // // Below code for change track and text in PIP mode iOS and android. - // // if (updateSpeakers.isNotEmpty) { - // // if (Platform.isIOS && (screenShareCount == 0 || isScreenShareOn)) { - // // if (updateSpeakers[0].peer.videoTrack != null) { - // // changePIPWindowTrackOnIOS( - // // track: updateSpeakers[0].peer.videoTrack, - // // alternativeText: updateSpeakers[0].peer.name, - // // ratio: [9, 16]); - // // } else { - // // changePIPWindowTextOnIOS( - // // text: updateSpeakers[0].peer.name, ratio: [9, 16]); - // // } - // // } else if (Platform.isAndroid) { - // // changePIPWindowOnAndroid("${updateSpeakers[0].peer.peerId}mainVideo"); - // // } - // // } } @override diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index d276d8185..4c36bb4bd 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 378 - versionName "1.5.78" + versionCode 379 + versionName "1.5.79" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 174319e80..70d6eb398 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.78 + 1.5.79 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 378 + 379 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 16aa782bc05f36b2b4e197df834ad9f7d67b8e88 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 30 Oct 2023 14:45:14 +0530 Subject: [PATCH 13/53] Updated widget tree in screenshare layout --- .../screen_share_grid_layout.dart | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart index b85c5796a..fde25e41a 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart @@ -67,22 +67,22 @@ class _ScreenshareGridLayoutState extends State { ///The active dot is the current page ///The inactive dots are the pages other than the current page if (widget.screenshareCount > 1) - Selector( - selector: (_, meetingStore) => - meetingStore.currentScreenSharePage, - builder: (_, currentScreenSharePage, __) { - return Padding( - padding: const EdgeInsets.only(top: 8.0), - child: DotsIndicator( + Padding( + padding: const EdgeInsets.only(top: 8.0), + child: Selector( + selector: (_, meetingStore) => + meetingStore.currentScreenSharePage, + builder: (_, currentScreenSharePage, __) { + return DotsIndicator( dotsCount: widget.screenshareCount, position: currentScreenSharePage, decorator: DotsDecorator( activeColor: HMSThemeColors.onSurfaceHighEmphasis, color: HMSThemeColors.onSurfaceLowEmphasis), - ), - ); - }) + ); + }), + ) ], )), From de6ccc6d5c1263bff427f76542cc179b2b32b413 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 30 Oct 2023 16:29:43 +0530 Subject: [PATCH 14/53] Added event channels in texture-view --- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 22 ++++----- .../hmssdk_flutter/views/HMSTextureView.kt | 32 +++++++------ .../lib/src/ui/meeting/hms_video_view.dart | 32 ++++++------- .../ui/meeting/hms_video_view_controller.dart | 47 ++++++++++++++----- 4 files changed, 77 insertions(+), 56 deletions(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 70e3e6974..39ecb3f91 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -81,9 +81,9 @@ class HmssdkFlutterPlugin : private var hmsKeyChangeObserverList = ArrayList() var hlsStreamUrl: String? = null - val renderers = HashMap() - var hmsTextureRegistry: TextureRegistry? = null - var hmsBinaryMessenger: BinaryMessenger? = null + private val renderers = HashMap() + private var hmsTextureRegistry: TextureRegistry? = null + private var hmsBinaryMessenger: BinaryMessenger? = null override fun onAttachedToEngine( @NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding, ) { @@ -468,6 +468,8 @@ class HmssdkFlutterPlugin : sessionStoreSink = null hlsPlayerSink = null hmssdkFlutterPlugin = null + hmsBinaryMessenger = null + hmsTextureRegistry = null } else { Log.e("Plugin Error", "hmssdkFlutterPlugin is null in onDetachedFromEngine") } @@ -640,6 +642,12 @@ class HmssdkFlutterPlugin : } } renderers["${surfaceTextureEntry.id()}"] = renderer + val eventChannel = EventChannel( + hmsBinaryMessenger, + "HMSTextureView/Texture/" + entry.id() + ) + eventChannel.setStreamHandler(renderer) + renderer.setTextureViewEventChannel(eventChannel) val data = HashMap() data["texture_id"] = surfaceTextureEntry.id() result.success(HMSResultExtension.toDictionary(true,data)) @@ -648,14 +656,6 @@ class HmssdkFlutterPlugin : HMSErrorLogger.returnHMSException("createTextureView","entry is null","NULL Error",result) return } -// val eventChannel = EventChannel( -// hmsBinaryMessenger, -// "HMSTextureView/Texture" + entry.id() -// ) - -// eventChannel.setStreamHandler(renderer) -// renderer.setTextureViewEventChannel(eventChannel) - } private fun disposeTextureView(call: MethodCall,result: Result){ diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 3b0bd0c77..20fdc8693 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -11,10 +11,10 @@ import live.hms.videoview.textureview.HMSTextureRenderer class HMSTextureView( texture: SurfaceTexture, var entry: TextureRegistry.SurfaceTextureEntry? -){ +):EventChannel.StreamHandler{ -// var eventChannel: EventChannel? = null -// var eventSink: EventSink? = null + var eventChannel: EventChannel? = null + var eventSink: EventSink? = null private var hmsTextureRenderer: HMSTextureRenderer? = null var uid: Long? = null init { @@ -25,11 +25,13 @@ class HMSTextureView( fun addTrack(track: HMSVideoTrack){ Log.i("HMSTextureView","Add Track called for track: ${track.trackId}") hmsTextureRenderer?.addTrack(track) + eventSink?.success("Hey there addTrack Called") } fun removeTrack(){ Log.i("HMSTextureView","Remove Track called") hmsTextureRenderer?.removeTrack() + eventSink?.success("Hey there removeTrack called") } fun disposeTextureView(){ @@ -38,17 +40,19 @@ class HMSTextureView( entry?.release() entry = null hmsTextureRenderer = null + this.eventChannel = null + eventSink = null } -// fun setTextureViewEventChannel(eventChannel:EventChannel){ -// this.eventChannel = eventChannel -// } -// -// override fun onListen(arguments: Any?, events: EventSink?) { -// eventSink = events -// } -// -// override fun onCancel(arguments: Any?) { -// eventSink = null -// } + fun setTextureViewEventChannel(eventChannel:EventChannel){ + this.eventChannel = eventChannel + } + + override fun onListen(arguments: Any?, events: EventSink?) { + eventSink = events + } + + override fun onCancel(arguments: Any?) { + eventSink = null + } } \ No newline at end of file diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index d7151ade1..bef35bbbe 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -34,6 +34,11 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; /// **key** - [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. /// Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. /// +/// **addTrackByDefault** - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] +/// +/// **controller** - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack +/// track functionalities on your own. +/// /// Refer [HMSVideoView guide here](https://www.100ms.live/docs/flutter/v2/features/render-video) class HMSVideoView extends StatelessWidget { /// This will render video with trackId present in the track @@ -54,8 +59,11 @@ class HMSVideoView extends StatelessWidget { /// [disableAutoSimulcastLayerSelect] - To disable auto simulcast (Adaptive Bitrate) final bool disableAutoSimulcastLayerSelect; + /// [addTrackByDefault] - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] final bool addTrackByDefault; + /// [controller] - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack + /// track functionalities on your own. final HMSVideoViewController? controller; ///100ms HMSVideoView @@ -159,7 +167,7 @@ class _PlatformViewState extends State<_PlatformView> { @override void dispose() { - if(widget.controller == null){ + if (widget.controller == null) { viewController?.disposeTextureView(callback: setView); } super.dispose(); @@ -179,34 +187,22 @@ class _PlatformViewState extends State<_PlatformView> { ? BoxFit.contain : BoxFit.cover, child: SizedBox( - width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT?(constraints.maxHeight * (16 / 9)):constraints.maxWidth, + width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT + ? (constraints.maxHeight * (16 / 9)) + : constraints.maxWidth, height: constraints.maxHeight, child: Center( child: Transform( transform: Matrix4.identity() ..rotateY(widget.setMirror ? -pi : 0.0), alignment: FractionalOffset.center, - child: Texture(textureId: viewController!.textureId!)), + child: + Texture(textureId: viewController!.textureId!)), ), ), ), ), ); - - // /Texture(textureId: textureId); // get textureId fom video view - // return AndroidView( - // viewType: 'HMSVideoView', - // onPlatformViewCreated: onPlatformViewCreated, - // creationParamsCodec: StandardMessageCodec(), - // creationParams: { - // 'track_id': track.trackId, - // 'set_mirror': track.source != "REGULAR" ? false : setMirror, - // 'scale_type': scaleType.value, - // 'match_parent': matchParent, - // 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect - // }, - // gestureRecognizers: {}, - // ); } else if (Platform.isIOS) { ///UIKitView for ios it uses VideoView provided by 100ms ios_sdk internally. return UiKitView( diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart index 1347e640f..90010b965 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart @@ -1,17 +1,32 @@ +///Dart imports import 'dart:developer'; +///Package imports +import 'package:flutter/services.dart'; + +///Project imports import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:hmssdk_flutter/src/service/platform_service.dart'; +///[HMSVideoViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. +///It is useful in custom usecases where you wish to control the addTrack and removeTrack functionalities on your own. class HMSVideoViewController { - int? textureId; + + ///[_textureId] is the unique id of the texture view + int? _textureId; + + ///getter for [_textureId] + int? get textureId => _textureId; HMSVideoViewController( - {HMSVideoTrack? track, bool addTrackByDefault = true,Function? callback}) { - createTextureView(track, addTrackByDefault,callback); + {HMSVideoTrack? track, + bool addTrackByDefault = true, + Function? callback}) { + createTextureView(track, addTrackByDefault, callback); } - void createTextureView(HMSTrack? track, bool addTrackByDefault, Function? callback) async { + void createTextureView( + HMSTrack? track, bool addTrackByDefault, Function? callback) async { log("HMSVideoViewController createTextureView called"); var result = await PlatformService.invokeMethod( PlatformMethod.createTextureView, @@ -20,21 +35,24 @@ class HMSVideoViewController { "add_track_by_def": addTrackByDefault }); if (result["success"]) { - textureId = result["data"]["texture_id"]; - if(callback != null){ + _textureId = result["data"]["texture_id"]; + EventChannel('HMSTextureView/Texture/$textureId') + .receiveBroadcastStream() + .listen(_eventListener); + if (callback != null) { callback(); } } } - void disposeTextureView({ Function? callback}) async { + void disposeTextureView({Function? callback}) async { log("HMSVideoViewController dispose video track"); var result = await PlatformService.invokeMethod( PlatformMethod.disposeTextureView, arguments: {"texture_id": textureId.toString()}); if (result["success"]) { - textureId = null; - if(callback != null){ + _textureId = null; + if (callback != null) { callback(); } } @@ -43,13 +61,16 @@ class HMSVideoViewController { void addTrack({required HMSVideoTrack track}) async { await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { "track_id": track.trackId, - "texture_id":textureId.toString() + "texture_id": textureId.toString() }); } void removeTrack() async { - await PlatformService.invokeMethod(PlatformMethod.removeTrack, arguments: { - "texture_id":textureId.toString() - }); + await PlatformService.invokeMethod(PlatformMethod.removeTrack, + arguments: {"texture_id": textureId.toString()}); + } + + void _eventListener(dynamic event) { + log("HMSVideoView Event Fired $event"); } } From d508514348f3e4078e8b67f6529f322ae04b50ba Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 21 Nov 2023 17:38:31 +0530 Subject: [PATCH 15/53] Updated android sdk branch --- packages/hms_room_kit/pubspec.lock | 7 ++- packages/hmssdk_flutter/android/build.gradle | 8 ++-- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 10 +++- .../hmssdk_flutter/views/HMSTextureView.kt | 30 ++++++++++-- packages/hmssdk_flutter/example/pubspec.lock | 7 ++- .../lib/src/ui/meeting/hms_video_view.dart | 44 ++++++++++-------- .../ui/meeting/hms_video_view_controller.dart | 46 +++++++++++++++---- 7 files changed, 104 insertions(+), 48 deletions(-) diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index 550e656a5..9bf592ecc 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -211,10 +211,9 @@ packages: hmssdk_flutter: dependency: "direct main" description: - name: hmssdk_flutter - sha256: e8b12fbdde193bc0bfbf0ef40086840c0b8d056778f01c53f4efa15849f35e38 - url: "https://pub.dev" - source: hosted + path: "../hmssdk_flutter" + relative: true + source: path version: "1.9.0" http: dependency: transitive diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index e8637eafb..e0d708496 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -10,6 +10,7 @@ buildscript { repositories { google() mavenCentral() + maven { url 'https://jitpack.io' } } dependencies { @@ -45,10 +46,9 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:feature~custom-texture-imp-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:feature~custom-texture-imp-SNAPSHOT" - implementation 'com.github.100mslive.android-sdk:lib:feature~custom-texture-imp-SNAPSHOT' - + implementation "com.github.100mslive.android-sdk:videoview:flutter-test-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:flutter-test-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:lib:flutter-test-SNAPSHOT" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 39ecb3f91..487bf7526 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -615,6 +615,9 @@ class HmssdkFlutterPlugin : val trackId = call.argument("track_id") val addTrackByDefault = call.argument("add_track_by_def")?:false + val disableAutoSimulcastLayerSelect = call.argument("disable_auto_simulcast_layer_select")?:false + val height = call.argument("height") + val width = call.argument("width") val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() entry?.let { surfaceTextureEntry -> @@ -627,7 +630,7 @@ class HmssdkFlutterPlugin : val track = HmsUtilities.getVideoTrack(currentTrackId,currentRoom) track?.let { videoTrack -> Log.i("HMSTextureView","Init Add Track called for track: ${track.trackId}") - renderer.addTrack(videoTrack) + renderer.addTrack(videoTrack,disableAutoSimulcastLayerSelect,height,width) }?: run { HMSErrorLogger.returnHMSException("createTextureView","No track with $trackId found","Track not found error",result) return @@ -682,6 +685,9 @@ class HmssdkFlutterPlugin : private fun addTrack(call: MethodCall, result: Result){ val trackId = call.argument("track_id") val textureId = call.argument("texture_id") + val disableAutoSimulcastLayerSelect = call.argument("disable_auto_simulcast_layer_select")?:false + val height = call.argument("height") + val width = call.argument("width") textureId?.let {texture -> trackId?.let { @@ -691,7 +697,7 @@ class HmssdkFlutterPlugin : room?.let { currentRoom -> val track = HmsUtilities.getVideoTrack(trackId,currentRoom) track?.let {videoTrack -> - textureRenderer.addTrack(videoTrack) + textureRenderer.addTrack(videoTrack,disableAutoSimulcastLayerSelect,height,width) result.success(null) }?: run { HMSErrorLogger.returnHMSException( diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 20fdc8693..879255318 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -6,24 +6,44 @@ import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.EventChannel.EventSink import io.flutter.view.TextureRegistry import live.hms.video.media.tracks.HMSVideoTrack +import live.hms.videoview.VideoViewStateChangeListener import live.hms.videoview.textureview.HMSTextureRenderer class HMSTextureView( texture: SurfaceTexture, - var entry: TextureRegistry.SurfaceTextureEntry? + private var entry: TextureRegistry.SurfaceTextureEntry? ):EventChannel.StreamHandler{ - var eventChannel: EventChannel? = null - var eventSink: EventSink? = null + private var eventChannel: EventChannel? = null + private var eventSink: EventSink? = null private var hmsTextureRenderer: HMSTextureRenderer? = null - var uid: Long? = null + private var uid: Long? = null init { hmsTextureRenderer = HMSTextureRenderer(texture) uid = entry?.id() } - fun addTrack(track: HMSVideoTrack){ + private val videoViewStateChangeListener = object : VideoViewStateChangeListener{ + override fun onResolutionChange(newWidth: kotlin.Int, newHeight: kotlin.Int) { + + } + + override fun onFirstFrameRendered() { + super.onFirstFrameRendered() + } + } + + fun addTrack(track: HMSVideoTrack, disableAutoSimulcastLayerSelect: Boolean, height: Int?, width: Int?){ Log.i("HMSTextureView","Add Track called for track: ${track.trackId}") + hmsTextureRenderer?.addVideoViewStateChangeListener(videoViewStateChangeListener) + hmsTextureRenderer?.disableAutoSimulcastLayerSelect(disableAutoSimulcastLayerSelect) + if(!disableAutoSimulcastLayerSelect){ + height?.let { videoHeight -> + width?.let { videoWidth -> + hmsTextureRenderer?.displayResolution(videoWidth,videoHeight) + } + } + } hmsTextureRenderer?.addTrack(track) eventSink?.success("Hey there addTrack Called") } diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 17dfcf534..3274e9089 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -298,10 +298,9 @@ packages: hmssdk_flutter: dependency: transitive description: - name: hmssdk_flutter - sha256: e8b12fbdde193bc0bfbf0ef40086840c0b8d056778f01c53f4efa15849f35e38 - url: "https://pub.dev" - source: hosted + path: ".." + relative: true + source: path version: "1.9.0" http: dependency: transitive diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index bef35bbbe..e346fa651 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -180,28 +180,32 @@ class _PlatformViewState extends State<_PlatformView> { return viewController?.textureId == null ? SizedBox() : LayoutBuilder( - builder: (context, constraints) => Center( - child: FittedBox( - clipBehavior: Clip.hardEdge, - fit: widget.scaleType == ScaleType.SCALE_ASPECT_FIT - ? BoxFit.contain - : BoxFit.cover, - child: SizedBox( - width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT - ? (constraints.maxHeight * (16 / 9)) - : constraints.maxWidth, - height: constraints.maxHeight, - child: Center( - child: Transform( - transform: Matrix4.identity() - ..rotateY(widget.setMirror ? -pi : 0.0), - alignment: FractionalOffset.center, - child: - Texture(textureId: viewController!.textureId!)), + builder: (context, constraints) { + viewController?.setHeightWidth( + constraints.maxHeight, constraints.maxWidth); + return Center( + child: FittedBox( + clipBehavior: Clip.hardEdge, + fit: widget.scaleType == ScaleType.SCALE_ASPECT_FIT + ? BoxFit.contain + : BoxFit.cover, + child: SizedBox( + width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT + ? (constraints.maxHeight * (16 / 9)) + : constraints.maxWidth, + height: constraints.maxHeight, + child: Center( + child: Transform( + transform: Matrix4.identity() + ..rotateY(widget.setMirror ? -pi : 0.0), + alignment: FractionalOffset.center, + child: + Texture(textureId: viewController!.textureId!)), + ), ), ), - ), - ), + ); + }, ); } else if (Platform.isIOS) { ///UIKitView for ios it uses VideoView provided by 100ms ios_sdk internally. diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart index 90010b965..7f0c40471 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart @@ -11,28 +11,42 @@ import 'package:hmssdk_flutter/src/service/platform_service.dart'; ///[HMSVideoViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. ///It is useful in custom usecases where you wish to control the addTrack and removeTrack functionalities on your own. class HMSVideoViewController { - ///[_textureId] is the unique id of the texture view int? _textureId; ///getter for [_textureId] int? get textureId => _textureId; + int? _height; + int? _width; + HMSVideoViewController( {HMSVideoTrack? track, bool addTrackByDefault = true, - Function? callback}) { - createTextureView(track, addTrackByDefault, callback); + Function? callback, + bool? disableAutoSimulcastLayerSelect = false}) { + createTextureView( + track: track, + addTrackByDefault: addTrackByDefault, + callback: callback, + disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect); } void createTextureView( - HMSTrack? track, bool addTrackByDefault, Function? callback) async { - log("HMSVideoViewController createTextureView called"); + {HMSTrack? track, + bool addTrackByDefault = true, + Function? callback, + bool? disableAutoSimulcastLayerSelect}) async { + log("VKohli Calling createTextureView -> disableAutoSimulcastLayerSelect:$disableAutoSimulcastLayerSelect height: $_height, width: $_width"); var result = await PlatformService.invokeMethod( PlatformMethod.createTextureView, arguments: { "track_id": track?.trackId, - "add_track_by_def": addTrackByDefault + "add_track_by_def": addTrackByDefault, + "disable_auto_simulcast_layer_select": + disableAutoSimulcastLayerSelect ?? false, + "width": _width, + "height": _height }); if (result["success"]) { _textureId = result["data"]["texture_id"]; @@ -46,7 +60,7 @@ class HMSVideoViewController { } void disposeTextureView({Function? callback}) async { - log("HMSVideoViewController dispose video track"); + log("VKohli Calling disposeTextureView"); var result = await PlatformService.invokeMethod( PlatformMethod.disposeTextureView, arguments: {"texture_id": textureId.toString()}); @@ -58,18 +72,32 @@ class HMSVideoViewController { } } - void addTrack({required HMSVideoTrack track}) async { + void addTrack( + {required HMSVideoTrack track, + bool? disableAutoSimulcastLayerSelect}) async { + log("VKohli Calling addTrack -> height: $_height, width: $_width"); await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { "track_id": track.trackId, - "texture_id": textureId.toString() + "texture_id": textureId.toString(), + "disable_auto_simulcast_layer_select": + disableAutoSimulcastLayerSelect ?? false, + "height": _height, + "width": _width }); } void removeTrack() async { + log("VKohli Calling removeTrack"); await PlatformService.invokeMethod(PlatformMethod.removeTrack, arguments: {"texture_id": textureId.toString()}); } + void setHeightWidth(double height, double width) { + log("VKohli Calling setHeightWidth-> height: $height, width: $width"); + _height = height.toInt(); + _width = width.toInt(); + } + void _eventListener(dynamic event) { log("HMSVideoView Event Fired $event"); } From 6587f31dfc633146e6bcb4ee8b6c1cf1aee719d7 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 21 Nov 2023 19:24:20 +0530 Subject: [PATCH 16/53] Updated versions --- packages/hmssdk_flutter/android/build.gradle | 6 +++--- packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index e0d708496..cba601316 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -46,9 +46,9 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:flutter-test-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:flutter-test-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:lib:flutter-test-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:videoview:flutterTextureView-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:flutterTextureView-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:lib:flutterTextureView-SNAPSHOT" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 4c36bb4bd..65f6c5cca 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 379 - versionName "1.5.79" + versionCode 390 + versionName "1.5.90" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 70d6eb398..720eac83a 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.79 + 1.5.90 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 379 + 390 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 4df3b3cd2a5965cf5a136e3feb199fa31e7220db Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 21 Nov 2023 19:26:07 +0530 Subject: [PATCH 17/53] Updated changelog --- .../example/ExampleAppChangelog.txt | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index f3ac83c9c..9fa1b24dc 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -1,21 +1,9 @@ Board: https://100ms.atlassian.net/jira/software/projects/FLUT/boards/34/ -- Fixed userid bug in prebuilt -https://github.com/100mslive/100ms-flutter/pull/1601 +- Added TextureView in place of SurfaceView for better performance +https://100ms.atlassian.net/browse/FLUT-121 -- Added first class api for hand raise and peer list updates -https://github.com/100mslive/100ms-flutter/pull/1600 - -- Added peer list iterator changes for large rooms -https://github.com/100mslive/100ms-flutter/pull/1602 - -Bug fixes: - -- Fix for local tile inset when inset is disabled after role changed - -- VoS joined from flutter cannot be removed from stage - -Room Kit: 1.0.3 -Core SDK: 1.9.0 -Android SDK: 2.7.7 -iOS SDK: 1.1.0 \ No newline at end of file +Room Kit: 1.0.6 +Core SDK: 1.9.3 +Android SDK: 2.8.1 +iOS SDK: 1.3.0 \ No newline at end of file From d537fd78e1299523512cc0fee4def29544f38f50 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 21 Nov 2023 19:31:24 +0530 Subject: [PATCH 18/53] Updated fastlane --- .../hmssdk_flutter/example/ios/Gemfile.lock | 44 +++++++++---------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/packages/hmssdk_flutter/example/ios/Gemfile.lock b/packages/hmssdk_flutter/example/ios/Gemfile.lock index f0920bc04..e2fe1a4ab 100644 --- a/packages/hmssdk_flutter/example/ios/Gemfile.lock +++ b/packages/hmssdk_flutter/example/ios/Gemfile.lock @@ -8,20 +8,20 @@ GEM artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.826.0) - aws-sdk-core (3.183.0) + aws-partitions (1.854.0) + aws-sdk-core (3.187.1) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.71.0) - aws-sdk-core (~> 3, >= 3.177.0) + aws-sdk-kms (1.72.0) + aws-sdk-core (~> 3, >= 3.184.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.135.0) + aws-sdk-s3 (1.137.0) aws-sdk-core (~> 3, >= 3.181.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.0) + aws-sigv4 (1.6.1) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) @@ -32,11 +32,10 @@ GEM declarative (0.0.20) digest-crc (0.6.5) rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) + domain_name (0.6.20231109) dotenv (2.8.1) emoji_regex (3.2.3) - excon (0.103.0) + excon (0.104.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -66,7 +65,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.7) - fastlane (2.216.0) + fastlane (2.217.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -106,13 +105,13 @@ GEM xcodeproj (>= 1.13.0, < 2.0.0) xcpretty (~> 0.3.0) xcpretty-travis-formatter (>= 0.0.3) - fastlane-plugin-firebase_app_distribution (0.7.3) + fastlane-plugin-firebase_app_distribution (0.7.4) google-apis-firebaseappdistribution_v1 (~> 0.3.0) fastlane-plugin-versioning (0.5.2) gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.49.0) + google-apis-androidpublisher_v3 (0.53.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-core (0.11.1) + google-apis-core (0.11.2) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -127,19 +126,19 @@ GEM google-apis-core (>= 0.11.0, < 2.a) google-apis-playcustomapp_v1 (0.13.0) google-apis-core (>= 0.11.0, < 2.a) - google-apis-storage_v1 (0.19.0) - google-apis-core (>= 0.9.0, < 2.a) + google-apis-storage_v1 (0.29.0) + google-apis-core (>= 0.11.0, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) google-cloud-errors (~> 1.0) google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.3.1) - google-cloud-storage (1.44.0) + google-cloud-storage (1.45.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.19.0) + google-apis-storage_v1 (~> 0.29.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -165,8 +164,8 @@ GEM optparse (0.1.1) os (1.1.4) plist (3.7.0) - public_suffix (5.0.3) - rake (13.0.6) + public_suffix (5.0.4) + rake (13.1.0) representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) @@ -194,13 +193,10 @@ GEM tty-spinner (0.9.3) tty-cursor (~> 0.7) uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8.2) - unicode-display_width (2.4.2) + unicode-display_width (2.5.0) webrick (1.8.1) word_wrap (1.0.0) - xcodeproj (1.22.0) + xcodeproj (1.23.0) CFPropertyList (>= 2.3.3, < 4.0) atomos (~> 0.1.3) claide (>= 1.0.2, < 2.0) From 5bde42535f83cd2e617babff3f5addfd32fcc6d0 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 22 Nov 2023 00:18:25 +0530 Subject: [PATCH 19/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?1=20(391)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 65f6c5cca..753b7621c 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 390 - versionName "1.5.90" + versionCode 391 + versionName "1.5.91" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 720eac83a..e01349c8a 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.90 + 1.5.91 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 390 + 391 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 96e45384f10d69d4d23aba74bdc20010d6c0f37f Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 23 Nov 2023 18:22:56 +0530 Subject: [PATCH 20/53] Fixed resolution issue --- .../lib/src/meeting/meeting_store.dart | 5 ++ .../src/widgets/common_widgets/peer_tile.dart | 2 +- .../grid_layouts/listenable_peer_widget.dart | 26 ++++-- packages/hmssdk_flutter/android/build.gradle | 6 +- .../hms/hmssdk_flutter/HmssdkFlutterPlugin.kt | 22 ++++- .../hmssdk_flutter/views/HMSTextureView.kt | 33 ++++++-- .../lib/src/common/platform_methods.dart | 7 +- .../lib/src/enum/hms_video_view_event.dart | 12 +++ .../lib/src/ui/meeting/hms_video_view.dart | 82 +++++++++++++------ .../ui/meeting/hms_video_view_controller.dart | 70 +++++++++++----- 10 files changed, 196 insertions(+), 69 deletions(-) create mode 100644 packages/hmssdk_flutter/lib/src/enum/hms_video_view_event.dart diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 5cff1ec7f..e924acb15 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -234,6 +234,9 @@ class MeetingStore extends ChangeNotifier ///Pool of video views List viewControllers = []; + ///Video View for screenshare + HMSVideoViewController? screenshareViewController; + Future join(String userName, String roomCode, {HMSConfig? roomConfig}) async { //If roomConfig is null then only we call the methods to get the authToken @@ -1281,7 +1284,9 @@ class MeetingStore extends ChangeNotifier 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) { diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index 5aa6fc211..a4c6f5bfa 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -77,7 +77,7 @@ class _PeerTileState extends State { Provider.of(context, listen: false) .setOffScreenStatus(false); if (context.read().track != null) { - log("HMSVideoViewController add video track ${context.read().peer.name}"); + log("HMSVideoViewController add video track ${context.read().peer.name} trackType: ${context.read().track?.source}"); widget.videoViewController ?.addTrack(track: context.read().track!); } diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart index e12730b94..6a20b8b9d 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart @@ -26,14 +26,22 @@ class ListenablePeerWidget extends StatelessWidget { key: ValueKey("${peerTracks[index].uid}video_view"), value: peerTracks[index], child: Selector( - selector: (_, meetingStore) => - meetingStore.viewControllers[index % 6], - builder: (_, viewController, __) { - return PeerTile( - videoViewController: viewController, - key: ValueKey("${peerTracks[index].uid}audio_view"), - scaleType: scaleType, - ); - })); + selector: (_, meetingStore) { + + ///Here we check if the track is of a screenshare + ///we render it using screenshareViewController + ///while for other tracks we render it using viewControllers list + if (peerTracks[index].track?.source == "SCREEN") { + meetingStore.screenshareViewController ??= HMSVideoViewController(addTrackByDefault: false); + return meetingStore.screenshareViewController!; + } + return meetingStore.viewControllers[index % 6]; + }, builder: (_, viewController, __) { + return PeerTile( + videoViewController: viewController, + key: ValueKey("${peerTracks[index].uid}audio_view"), + scaleType: scaleType, + ); + })); } } diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index cba601316..a6ecb3b16 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -46,9 +46,9 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:flutterTextureView-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:flutterTextureView-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:lib:flutterTextureView-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:videoview:flutter-blframe-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:flutter-blframe-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:lib:flutter-blframe-SNAPSHOT" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt index 487bf7526..679010add 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/HmssdkFlutterPlugin.kt @@ -269,6 +269,10 @@ class HmssdkFlutterPlugin : removeTrack(call,result) } + "set_display_resolution" -> { + setDisplayResolution(call,result) + } + "get_peer_list_iterator", "peer_list_iterator_has_next", "peer_list_iterator_next" -> { HMSPeerListIteratorAction.peerListIteratorAction(call, result, hmssdk!!) } @@ -616,8 +620,6 @@ class HmssdkFlutterPlugin : val trackId = call.argument("track_id") val addTrackByDefault = call.argument("add_track_by_def")?:false val disableAutoSimulcastLayerSelect = call.argument("disable_auto_simulcast_layer_select")?:false - val height = call.argument("height") - val width = call.argument("width") val entry: SurfaceTextureEntry? = hmsTextureRegistry?.createSurfaceTexture() entry?.let { surfaceTextureEntry -> @@ -630,7 +632,7 @@ class HmssdkFlutterPlugin : val track = HmsUtilities.getVideoTrack(currentTrackId,currentRoom) track?.let { videoTrack -> Log.i("HMSTextureView","Init Add Track called for track: ${track.trackId}") - renderer.addTrack(videoTrack,disableAutoSimulcastLayerSelect,height,width) + renderer.addTrack(videoTrack,disableAutoSimulcastLayerSelect) }?: run { HMSErrorLogger.returnHMSException("createTextureView","No track with $trackId found","Track not found error",result) return @@ -750,6 +752,20 @@ class HmssdkFlutterPlugin : } + private fun setDisplayResolution(call: MethodCall, result: Result){ + val textureId = call.argument("texture_id") + val height = call.argument("height") + val width = call.argument("width") + val renderer = renderers[textureId] + + height?.let { videoViewHeight -> + width?.let { videoViewWidth -> + renderer?.setDisplayResolution(videoViewWidth,videoViewHeight) + } + } + result.success(null) + } + private fun getAllTracks(): ArrayList { val room = hmssdk!!.getRoom() val allTracks = ArrayList() diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 879255318..9d70dc219 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -5,6 +5,10 @@ import android.util.Log import io.flutter.plugin.common.EventChannel import io.flutter.plugin.common.EventChannel.EventSink import io.flutter.view.TextureRegistry +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import live.hms.hmssdk_flutter.HMSTrackUpdateExtension import live.hms.video.media.tracks.HMSVideoTrack import live.hms.videoview.VideoViewStateChangeListener import live.hms.videoview.textureview.HMSTextureRenderer @@ -25,7 +29,18 @@ class HMSTextureView( private val videoViewStateChangeListener = object : VideoViewStateChangeListener{ override fun onResolutionChange(newWidth: kotlin.Int, newHeight: kotlin.Int) { - + Log.i("Vkohli", "onResolutionChange -> newWidth:$newWidth, newHeight-> $newHeight") + val args = HashMap() + args["event_name"] = "on_resolution_changed" + val data = HashMap() + data["height"] = newHeight + data["width"] = newWidth + args["data"] = data + if (args["data"] != null) { + CoroutineScope(Dispatchers.Main).launch { + eventSink?.success(args) + } + } } override fun onFirstFrameRendered() { @@ -33,25 +48,27 @@ class HMSTextureView( } } - fun addTrack(track: HMSVideoTrack, disableAutoSimulcastLayerSelect: Boolean, height: Int?, width: Int?){ + fun addTrack(track: HMSVideoTrack, disableAutoSimulcastLayerSelect: Boolean, height: Int? = null, width: Int? = null){ Log.i("HMSTextureView","Add Track called for track: ${track.trackId}") hmsTextureRenderer?.addVideoViewStateChangeListener(videoViewStateChangeListener) hmsTextureRenderer?.disableAutoSimulcastLayerSelect(disableAutoSimulcastLayerSelect) if(!disableAutoSimulcastLayerSelect){ - height?.let { videoHeight -> - width?.let { videoWidth -> - hmsTextureRenderer?.displayResolution(videoWidth,videoHeight) + height?.let { videoViewHeight -> + width?.let { videoViewWidth -> + hmsTextureRenderer?.displayResolution(videoViewWidth,videoViewHeight) } } } - hmsTextureRenderer?.addTrack(track) - eventSink?.success("Hey there addTrack Called") + hmsTextureRenderer?.addTrack(track,true) + } + + fun setDisplayResolution(width: Int, height: Int){ + hmsTextureRenderer?.displayResolution(width,height) } fun removeTrack(){ Log.i("HMSTextureView","Remove Track called") hmsTextureRenderer?.removeTrack() - eventSink?.success("Hey there removeTrack called") } fun disposeTextureView(){ diff --git a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart index a552ce571..1d22ec82c 100644 --- a/packages/hmssdk_flutter/lib/src/common/platform_methods.dart +++ b/packages/hmssdk_flutter/lib/src/common/platform_methods.dart @@ -199,7 +199,8 @@ enum PlatformMethod { createTextureView, disposeTextureView, addTrack, - removeTrack + removeTrack, + setDisplayResolution } extension PlatformMethodValues on PlatformMethod { @@ -500,6 +501,8 @@ extension PlatformMethodValues on PlatformMethod { return "add_track"; case PlatformMethod.removeTrack: return "remove_track"; + case PlatformMethod.setDisplayResolution: + return "set_display_resolution"; default: return 'unknown'; } @@ -802,6 +805,8 @@ extension PlatformMethodValues on PlatformMethod { return PlatformMethod.addTrack; case "remove_track": return PlatformMethod.removeTrack; + case "set_display_resolution": + return PlatformMethod.setDisplayResolution; default: return PlatformMethod.unknown; } diff --git a/packages/hmssdk_flutter/lib/src/enum/hms_video_view_event.dart b/packages/hmssdk_flutter/lib/src/enum/hms_video_view_event.dart new file mode 100644 index 000000000..a20402ef7 --- /dev/null +++ b/packages/hmssdk_flutter/lib/src/enum/hms_video_view_event.dart @@ -0,0 +1,12 @@ +enum HMSVideoViewEvent { onResolutionChanged, unknown } + +extension HMSVideoViewValues on HMSVideoViewEvent { + static HMSVideoViewEvent getHMSVideoViewEventFromString(String event) { + switch (event) { + case "on_resolution_changed": + return HMSVideoViewEvent.onResolutionChanged; + default: + return HMSVideoViewEvent.unknown; + } + } +} diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index e346fa651..57b6fefe9 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -151,11 +151,12 @@ class _PlatformViewState extends State<_PlatformView> { @override void initState() { if (widget.controller == null) { - viewController = HMSVideoViewController( - track: widget.track as HMSVideoTrack, callback: setView); + viewController = + HMSVideoViewController(track: widget.track as HMSVideoTrack); } else { viewController = widget.controller; } + viewController?.setCallbackMethod(setView); super.initState(); } @@ -168,7 +169,7 @@ class _PlatformViewState extends State<_PlatformView> { @override void dispose() { if (widget.controller == null) { - viewController?.disposeTextureView(callback: setView); + viewController?.disposeTextureView(); } super.dispose(); } @@ -182,28 +183,25 @@ class _PlatformViewState extends State<_PlatformView> { : LayoutBuilder( builder: (context, constraints) { viewController?.setHeightWidth( - constraints.maxHeight, constraints.maxWidth); + height: constraints.maxHeight, width: constraints.maxWidth); return Center( - child: FittedBox( - clipBehavior: Clip.hardEdge, - fit: widget.scaleType == ScaleType.SCALE_ASPECT_FIT - ? BoxFit.contain - : BoxFit.cover, - child: SizedBox( - width: widget.scaleType == ScaleType.SCALE_ASPECT_FIT - ? (constraints.maxHeight * (16 / 9)) - : constraints.maxWidth, - height: constraints.maxHeight, - child: Center( - child: Transform( - transform: Matrix4.identity() - ..rotateY(widget.setMirror ? -pi : 0.0), - alignment: FractionalOffset.center, - child: - Texture(textureId: viewController!.textureId!)), - ), - ), - ), + child: widget.scaleType != ScaleType.SCALE_ASPECT_FIT + ? Container( + width: constraints.maxWidth, + height: constraints.maxHeight, + child: HMSTextureView( + scaleType: widget.scaleType, + viewController: viewController, + constraints: constraints, + setMirror: widget.setMirror, + ), + ) + : HMSTextureView( + scaleType: widget.scaleType, + viewController: viewController, + constraints: constraints, + setMirror: widget.setMirror, + ), ); }, ); @@ -230,3 +228,39 @@ class _PlatformViewState extends State<_PlatformView> { } } } + +class HMSTextureView extends StatelessWidget { + const HMSTextureView( + {Key? key, + required this.scaleType, + required this.viewController, + required this.constraints, + required this.setMirror}) + : super(key: key); + + final ScaleType scaleType; + final HMSVideoViewController? viewController; + final BoxConstraints constraints; + final bool setMirror; + + @override + Widget build(BuildContext context) { + return FittedBox( + clipBehavior: Clip.hardEdge, + fit: scaleType == ScaleType.SCALE_ASPECT_FIT + ? BoxFit.contain + : BoxFit.cover, + child: SizedBox( + width: (constraints.maxHeight * + ((viewController != null) ? viewController!.aspectRatio : 1)), + height: constraints.maxHeight, + child: Center( + child: Transform( + transform: Matrix4.identity()..rotateY(setMirror ? -pi : 0.0), + alignment: FractionalOffset.center, + child: Texture(textureId: viewController!.textureId!)), + ), + ), + ); + } +} diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart index 7f0c40471..b3a6e7bb1 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart @@ -6,6 +6,7 @@ import 'package:flutter/services.dart'; ///Project imports import 'package:hmssdk_flutter/hmssdk_flutter.dart'; +import 'package:hmssdk_flutter/src/enum/hms_video_view_event.dart'; import 'package:hmssdk_flutter/src/service/platform_service.dart'; ///[HMSVideoViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. @@ -19,23 +20,22 @@ class HMSVideoViewController { int? _height; int? _width; + Function? _updateViewCallback; + double aspectRatio = 1; HMSVideoViewController( {HMSVideoTrack? track, bool addTrackByDefault = true, - Function? callback, bool? disableAutoSimulcastLayerSelect = false}) { createTextureView( track: track, addTrackByDefault: addTrackByDefault, - callback: callback, disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect); } void createTextureView( {HMSTrack? track, bool addTrackByDefault = true, - Function? callback, bool? disableAutoSimulcastLayerSelect}) async { log("VKohli Calling createTextureView -> disableAutoSimulcastLayerSelect:$disableAutoSimulcastLayerSelect height: $_height, width: $_width"); var result = await PlatformService.invokeMethod( @@ -44,31 +44,31 @@ class HMSVideoViewController { "track_id": track?.trackId, "add_track_by_def": addTrackByDefault, "disable_auto_simulcast_layer_select": - disableAutoSimulcastLayerSelect ?? false, - "width": _width, - "height": _height + disableAutoSimulcastLayerSelect ?? false }); if (result["success"]) { _textureId = result["data"]["texture_id"]; EventChannel('HMSTextureView/Texture/$textureId') .receiveBroadcastStream() .listen(_eventListener); - if (callback != null) { - callback(); + if (_updateViewCallback != null) { + _updateViewCallback!(); } } } - void disposeTextureView({Function? callback}) async { + void setCallbackMethod(Function callback) { + log("VKohli Calling setCallbackMethod -> $callback"); + _updateViewCallback = callback; + } + + void disposeTextureView() async { log("VKohli Calling disposeTextureView"); var result = await PlatformService.invokeMethod( PlatformMethod.disposeTextureView, arguments: {"texture_id": textureId.toString()}); if (result["success"]) { _textureId = null; - if (callback != null) { - callback(); - } } } @@ -86,19 +86,49 @@ class HMSVideoViewController { }); } - void removeTrack() async { - log("VKohli Calling removeTrack"); - await PlatformService.invokeMethod(PlatformMethod.removeTrack, + void _setDisplayResolution({required int height, required int width}) { + PlatformService.invokeMethod(PlatformMethod.setDisplayResolution, + arguments: { + "texture_id": textureId.toString(), + "height": height, + "width": width + }); + } + + void removeTrack() { + PlatformService.invokeMethod(PlatformMethod.removeTrack, arguments: {"texture_id": textureId.toString()}); } - void setHeightWidth(double height, double width) { - log("VKohli Calling setHeightWidth-> height: $height, width: $width"); - _height = height.toInt(); - _width = width.toInt(); + void setHeightWidth({required double height, required double width}) { + if (_height != height.toInt() || _width != width.toInt()) { + log("VKohli Calling setHeightWidth-> height: $height, width: $width"); + _height = height.toInt(); + _width = width.toInt(); + _setDisplayResolution(height: _height!, width: _width!); + } } void _eventListener(dynamic event) { - log("HMSVideoView Event Fired $event"); + log("VKohli HMSVideoView Event Fired $event"); + + HMSVideoViewEvent videoViewEvent = + HMSVideoViewValues.getHMSVideoViewEventFromString(event['event_name']); + switch (videoViewEvent) { + case HMSVideoViewEvent.onResolutionChanged: + int width = event['data']?['width']; + int height = event['data']?['height']; + + if (width == 0.0 || height == 0.0) { + aspectRatio = 1.0; + } + aspectRatio = width / height; + if (_updateViewCallback != null) { + _updateViewCallback!(); + } + break; + case HMSVideoViewEvent.unknown: + break; + } } } From 2199554579933abde87838c7f9f20b83a3187b95 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 23 Nov 2023 18:24:27 +0530 Subject: [PATCH 21/53] Updated gemfile --- packages/hmssdk_flutter/example/ios/Gemfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/hmssdk_flutter/example/ios/Gemfile.lock b/packages/hmssdk_flutter/example/ios/Gemfile.lock index e2fe1a4ab..746536539 100644 --- a/packages/hmssdk_flutter/example/ios/Gemfile.lock +++ b/packages/hmssdk_flutter/example/ios/Gemfile.lock @@ -7,21 +7,21 @@ GEM public_suffix (>= 2.0.2, < 6.0) artifactory (3.0.15) atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.854.0) - aws-sdk-core (3.187.1) + aws-eventstream (1.3.0) + aws-partitions (1.855.0) + aws-sdk-core (3.188.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.5) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.72.0) - aws-sdk-core (~> 3, >= 3.184.0) + aws-sdk-kms (1.73.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.137.0) - aws-sdk-core (~> 3, >= 3.181.0) + aws-sdk-s3 (1.139.0) + aws-sdk-core (~> 3, >= 3.188.0) aws-sdk-kms (~> 1) aws-sigv4 (~> 1.6) - aws-sigv4 (1.6.1) + aws-sigv4 (1.7.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) claide (1.1.0) From 6b83afadeeefdc8d8870fe59091a0afdc9e8ddf5 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 24 Nov 2023 12:16:45 +0530 Subject: [PATCH 22/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?2=20(392)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 753b7621c..5236d4039 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 391 - versionName "1.5.91" + versionCode 392 + versionName "1.5.92" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index e01349c8a..03adab0f8 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.91 + 1.5.92 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 391 + 392 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 106df2a108cbcf338e1d6c934b84900363e22dba Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 24 Nov 2023 18:03:00 +0530 Subject: [PATCH 23/53] Updated texture view implementation --- .../lib/src/meeting/meeting_store.dart | 6 +- .../lib/src/preview/preview_page.dart | 2 +- .../src/widgets/common_widgets/peer_tile.dart | 2 +- .../widgets/common_widgets/video_view.dart | 6 +- .../grid_layouts/listenable_peer_widget.dart | 8 +- .../views/HMSVideoViewFactory.kt | 18 +- .../hmssdk_flutter/lib/hmssdk_flutter.dart | 3 +- .../lib/src/ui/meeting/hms_texture_view.dart | 242 ++++++++++++++++++ ....dart => hms_texture_view_controller.dart} | 33 ++- .../lib/src/ui/meeting/hms_video_view.dart | 152 ++--------- 10 files changed, 320 insertions(+), 152 deletions(-) create mode 100644 packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart rename packages/hmssdk_flutter/lib/src/ui/meeting/{hms_video_view_controller.dart => hms_texture_view_controller.dart} (67%) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index e924acb15..3209ab354 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -232,10 +232,10 @@ class MeetingStore extends ChangeNotifier bool isRecordingInInitialisingState = false; ///Pool of video views - List viewControllers = []; + List viewControllers = []; ///Video View for screenshare - HMSVideoViewController? screenshareViewController; + HMSTextureViewController? screenshareViewController; Future join(String userName, String roomCode, {HMSConfig? roomConfig}) async { @@ -850,7 +850,7 @@ class MeetingStore extends ChangeNotifier void setViewControllers() { for (var i = 0; i < 6; i++) { - viewControllers.add(HMSVideoViewController(addTrackByDefault: false)); + viewControllers.add(HMSTextureViewController(addTrackByDefault: false)); } } diff --git a/packages/hms_room_kit/lib/src/preview/preview_page.dart b/packages/hms_room_kit/lib/src/preview/preview_page.dart index 64d0a8edd..7dc1a9194 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_page.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_page.dart @@ -227,7 +227,7 @@ class _PreviewPageState extends State { ///Otherwise it will render the circular avatar child: (previewStore.isVideoOn) ? Center( - child: HMSVideoView( + child: HMSTextureView( scaleType: ScaleType .SCALE_ASPECT_FILL, track: previewStore diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index a4c6f5bfa..d19d4ec7e 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -37,7 +37,7 @@ class PeerTile extends StatefulWidget { final double avatarRadius; final double avatarTitleFontSize; final double avatarTitleTextLineHeight; - final HMSVideoViewController? videoViewController; + final HMSTextureViewController? videoViewController; const PeerTile( {Key? key, this.scaleType = ScaleType.SCALE_ASPECT_FILL, diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index fe3b414ae..09dfb7af0 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -33,7 +33,7 @@ class VideoView extends StatefulWidget { final double avatarRadius; final double avatarTitleFontSize; final double avatarTitleTextLineHeight; - final HMSVideoViewController? videoViewController; + final HMSTextureViewController? videoViewController; const VideoView( {Key? key, @@ -81,7 +81,7 @@ class _VideoViewState extends State { ? InteractiveViewer( // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. - child: HMSVideoView( + child: HMSTextureView( controller: widget.videoViewController, addTrackByDefault: !context.read().isOffscreen, @@ -96,7 +96,7 @@ class _VideoViewState extends State { : SizedBox( // [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. // Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. - child: HMSVideoView( + child: HMSTextureView( controller: widget.videoViewController, addTrackByDefault: !context.read().isOffscreen, diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart index 6a20b8b9d..47c29fc16 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/listenable_peer_widget.dart @@ -25,14 +25,14 @@ class ListenablePeerWidget extends StatelessWidget { return ChangeNotifierProvider.value( key: ValueKey("${peerTracks[index].uid}video_view"), value: peerTracks[index], - child: Selector( + child: Selector( selector: (_, meetingStore) { - - ///Here we check if the track is of a screenshare + ///Here we check if the track is of a screenshare ///we render it using screenshareViewController ///while for other tracks we render it using viewControllers list if (peerTracks[index].track?.source == "SCREEN") { - meetingStore.screenshareViewController ??= HMSVideoViewController(addTrackByDefault: false); + meetingStore.screenshareViewController ??= + HMSTextureViewController(addTrackByDefault: false); return meetingStore.screenshareViewController!; } return meetingStore.viewControllers[index % 6]; diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt index eb3032cb5..cf903c056 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSVideoViewFactory.kt @@ -24,9 +24,9 @@ class HMSVideoViewWidget( private var hmsVideoView: HMSVideoView? = null init { -// if (hmsVideoView == null) { -// hmsVideoView = HMSVideoView(context, setMirror, scaleType, track, disableAutoSimulcastLayerSelect, hmssdkFlutterPlugin) -// } + if (hmsVideoView == null) { + hmsVideoView = HMSVideoView(context, setMirror, scaleType, track, disableAutoSimulcastLayerSelect, hmssdkFlutterPlugin) + } } override fun getView(): View? { @@ -34,12 +34,12 @@ class HMSVideoViewWidget( } override fun dispose() { -// if (hmsVideoView != null) { -// hmsVideoView?.onDisposeCalled() -// } else { -// Log.e("HMSVideoView error", "onDisposeCalled error hmsVideoView is null") -// } -// hmsVideoView = null + if (hmsVideoView != null) { + hmsVideoView?.onDisposeCalled() + } else { + Log.e("HMSVideoView error", "onDisposeCalled error hmsVideoView is null") + } + hmsVideoView = null } } diff --git a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart index e564b4a33..691329cea 100644 --- a/packages/hmssdk_flutter/lib/hmssdk_flutter.dart +++ b/packages/hmssdk_flutter/lib/hmssdk_flutter.dart @@ -102,6 +102,7 @@ export 'src/model/hms_peer_list_iterator.dart'; export 'src/model/peer_list_iterator_options.dart'; //Views +export 'src/ui/meeting/hms_texture_view.dart'; export 'src/ui/meeting/hms_video_view.dart'; export 'src/ui/meeting/hms_hls_player.dart'; -export 'src/ui/meeting/hms_video_view_controller.dart'; +export 'src/ui/meeting/hms_texture_view_controller.dart'; diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart new file mode 100644 index 000000000..5d266d800 --- /dev/null +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart @@ -0,0 +1,242 @@ +// Dart imports: +import 'dart:io' show Platform; +import 'dart:math'; + +// Flutter imports: +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart' show StandardMessageCodec; + +// Project imports: +import 'package:hmssdk_flutter/hmssdk_flutter.dart'; + +///100ms HMSTextureView +/// +///HMSTextureView used to render video in ios and android devices +/// +///In android devices, [HMSTextureView] uses texture to render videos while [HMSVideoView] uses surfaceView to render videos. +///In iOS there is no difference between [HMSTextureView] and [HMSVideoView]. +/// +/// To use,import package:`hmssdk_flutter/ui/meeting/hms_texture_view.dart`. +/// +/// [HMSTextureView] renders video using trackId from HMSTrack +/// +/// **parameters** +/// +/// **track** - This will render video with trackId present in the track. Use video track only. +/// +/// **scaleType** - To set the video scaling. [SCALE_ASPECT_FIT, SCALE_ASPECT_FILL, SCALE_ASPECT_BALANCED] +/// +/// **setMirror** - To set mirroring of video +/// +/// **disableAutoSimulcastLayerSelect** - To disable auto simulcast (Adaptive Bitrate) +/// +/// **key** - [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. +/// Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. +/// +/// **addTrackByDefault** - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] +/// +/// **controller** - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack +/// track functionalities on your own. +/// +/// Refer [HMSVideoView guide here](https://www.100ms.live/docs/flutter/v2/features/render-video) +class HMSTextureView extends StatelessWidget { + /// This will render video with trackId present in the track + /// [track] - the video track to be displayed + final HMSVideoTrack track; + + /// [scaleType] - To set the video scaling. + /// + /// ScaleType can be one of the following: [SCALE_ASPECT_FIT, SCALE_ASPECT_FILL, SCALE_ASPECT_BALANCED] + /// Default is [ScaleType.SCALE_ASPECT_FIT] + final ScaleType scaleType; + + /// [setMirror] - To set mirroring of video + final bool setMirror; + + /// [disableAutoSimulcastLayerSelect] - To disable auto simulcast (Adaptive Bitrate) + /// Default is [false] + final bool disableAutoSimulcastLayerSelect; + + /// [addTrackByDefault] - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] + final bool addTrackByDefault; + + /// [controller] - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack + /// track functionalities on your own. + final HMSTextureViewController? controller; + + HMSTextureView( + {Key? key, + required this.track, + this.setMirror = false, + this.scaleType = ScaleType.SCALE_ASPECT_FIT, + this.disableAutoSimulcastLayerSelect = false, + this.addTrackByDefault = true, + this.controller}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return _PlatformView( + track: track, + setMirror: setMirror, + scaleType: this.scaleType, + disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect, + addTrackByDefault: addTrackByDefault, + controller: controller, + ); + } +} + +class _PlatformView extends StatefulWidget { + final HMSTrack track; + final bool setMirror; + final ScaleType scaleType; + final bool disableAutoSimulcastLayerSelect; + final bool addTrackByDefault; + final HMSTextureViewController? controller; + + _PlatformView( + {Key? key, + required this.track, + this.setMirror = false, + required this.scaleType, + this.disableAutoSimulcastLayerSelect = false, + this.addTrackByDefault = true, + this.controller}) + : super(key: key); + + @override + State<_PlatformView> createState() => _PlatformViewState(); +} + +class _PlatformViewState extends State<_PlatformView> { + HMSTextureViewController? viewController; + + @override + void initState() { + ///If controller is null, then we create a new controller + ///else we use the controller provided by the app. + if (widget.controller == null) { + viewController = + HMSTextureViewController(track: widget.track as HMSVideoTrack); + } else { + viewController = widget.controller; + } + + ///Here we set the callback method which gets called to set the view + viewController?.setCallbackMethod(setView); + super.initState(); + } + + ///This sets the view whenever any changes are performed in the properties of the view. + void setView() { + if (mounted) { + setState(() {}); + } + } + + @override + void dispose() { + ///Here we dispose the texture view + /// + ///Note that if the controller is created from app + ///then the application needs to call this method explicitly. + if (widget.controller == null) { + viewController?.disposeTextureView(); + } + super.dispose(); + } + + @override + Widget build(BuildContext context) { + if (Platform.isAndroid) { + ///Here if the textureId is null we render an empty SizedBox + ///We get the textureId from createTextureView method in HMSTextureViewController + return viewController?.textureId == null + ? SizedBox() + : LayoutBuilder( + key: widget.key, + builder: (context, constraints) { + ///This method sets the height and width of the video based on the + ///size of video tile. + viewController?.setHeightWidth( + height: constraints.maxHeight, width: constraints.maxWidth); + return Center( + child: widget.scaleType != ScaleType.SCALE_ASPECT_FIT + ? Container( + width: constraints.maxWidth, + height: constraints.maxHeight, + child: TextureView( + scaleType: widget.scaleType, + viewController: viewController, + constraints: constraints, + setMirror: widget.setMirror, + ), + ) + : TextureView( + scaleType: widget.scaleType, + viewController: viewController, + constraints: constraints, + setMirror: widget.setMirror, + ), + ); + }, + ); + } else if (Platform.isIOS) { + ///UIKitView for ios it uses VideoView provided by 100ms ios_sdk internally. + return UiKitView( + viewType: 'HMSFlutterPlatformView', + creationParamsCodec: StandardMessageCodec(), + creationParams: { + 'track_id': widget.track.trackId, + 'set_mirror': + widget.track.source != "REGULAR" ? false : widget.setMirror, + 'scale_type': widget.scaleType.value, + 'disable_auto_simulcast_layer_select': + widget.disableAutoSimulcastLayerSelect + }, + gestureRecognizers: {}, + ); + } else { + throw UnimplementedError( + 'Video View is not implemented for this platform ${Platform.localHostname}'); + } + } +} + +///[TextureView] returns a Texture surface to render the video +class TextureView extends StatelessWidget { + const TextureView( + {Key? key, + required this.scaleType, + required this.viewController, + required this.constraints, + required this.setMirror}) + : super(key: key); + + final ScaleType scaleType; + final HMSTextureViewController? viewController; + final BoxConstraints constraints; + final bool setMirror; + + @override + Widget build(BuildContext context) { + return FittedBox( + clipBehavior: Clip.hardEdge, + fit: scaleType == ScaleType.SCALE_ASPECT_FIT + ? BoxFit.contain + : BoxFit.cover, + child: SizedBox( + width: (constraints.maxHeight * + ((viewController != null) ? viewController!.aspectRatio : 1)), + height: constraints.maxHeight, + child: Center( + child: Transform( + transform: Matrix4.identity()..rotateY(setMirror ? -pi : 0.0), + alignment: FractionalOffset.center, + child: Texture(textureId: viewController!.textureId!)), + ), + ), + ); + } +} diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart similarity index 67% rename from packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart rename to packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart index b3a6e7bb1..01c918768 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart @@ -9,21 +9,31 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:hmssdk_flutter/src/enum/hms_video_view_event.dart'; import 'package:hmssdk_flutter/src/service/platform_service.dart'; -///[HMSVideoViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. +///[HMSTextureViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. ///It is useful in custom usecases where you wish to control the addTrack and removeTrack functionalities on your own. -class HMSVideoViewController { +///Please note that if you control the view creation, addTrack etc. on application, then application has the responsibility +///to release the texture view as well by calling [disposeTextureView] +class HMSTextureViewController { ///[_textureId] is the unique id of the texture view int? _textureId; ///getter for [_textureId] int? get textureId => _textureId; + ///[_height] is the height of the view int? _height; + + ///[_width] is the width of the view int? _width; + + ///[_updateViewCallback] is the callback required for refreshing the view when certain + ///properties of the view changes. Function? _updateViewCallback; + + ///[aspectRatio] is the aspect ratio of the view double aspectRatio = 1; - HMSVideoViewController( + HMSTextureViewController( {HMSVideoTrack? track, bool addTrackByDefault = true, bool? disableAutoSimulcastLayerSelect = false}) { @@ -33,6 +43,10 @@ class HMSVideoViewController { disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect); } + ///[createTextureView] is used to create the texture view. It takes [track] as an optional parameter. + ///If [track] is provided, then it will add the track to the texture view by default. + ///If [addTrackByDefault] is set to true, then it will add the track to the texture view by default. + ///If [disableAutoSimulcastLayerSelect] is set to true, then it will disable the auto simulcast layer selection. void createTextureView( {HMSTrack? track, bool addTrackByDefault = true, @@ -57,11 +71,16 @@ class HMSVideoViewController { } } + ///[setCallbackMethod] is used to set the callback method for the texture view. + ///This callback method is used to refresh the view when certain properties of the view changes. void setCallbackMethod(Function callback) { log("VKohli Calling setCallbackMethod -> $callback"); _updateViewCallback = callback; } + ///[disposeTextureView] is used to dispose the texture view. + ///It is the responsibility of the application to dispose the texture view if the controller is created + ///by the application. void disposeTextureView() async { log("VKohli Calling disposeTextureView"); var result = await PlatformService.invokeMethod( @@ -72,6 +91,8 @@ class HMSVideoViewController { } } + ///[addTrack] is used to add the track to the texture view. + ///If [disableAutoSimulcastLayerSelect] is set to true, then it will disable the auto simulcast layer selection. void addTrack( {required HMSVideoTrack track, bool? disableAutoSimulcastLayerSelect}) async { @@ -86,6 +107,8 @@ class HMSVideoViewController { }); } + ///[_setDisplayResolution] is used to set the display resolution of the texture view. + ///It is used internally by the SDK. void _setDisplayResolution({required int height, required int width}) { PlatformService.invokeMethod(PlatformMethod.setDisplayResolution, arguments: { @@ -95,11 +118,13 @@ class HMSVideoViewController { }); } + ///[removeTrack] is used to remove the track from the texture view. void removeTrack() { PlatformService.invokeMethod(PlatformMethod.removeTrack, arguments: {"texture_id": textureId.toString()}); } + ///[setHeightWidth] is used to set the height and width of the texture view. void setHeightWidth({required double height, required double width}) { if (_height != height.toInt() || _width != width.toInt()) { log("VKohli Calling setHeightWidth-> height: $height, width: $width"); @@ -109,6 +134,8 @@ class HMSVideoViewController { } } + ///[_eventListener] is the callback method for the texture view. + ///We get the native callbacks like [onResolutionChanged] from the texture view. void _eventListener(dynamic event) { log("VKohli HMSVideoView Event Fired $event"); diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart index 57b6fefe9..c2f544c73 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_video_view.dart @@ -1,9 +1,9 @@ // Dart imports: import 'dart:io' show Platform; -import 'dart:math'; // Flutter imports: import 'package:flutter/material.dart'; +import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart' show StandardMessageCodec; // Project imports: @@ -34,11 +34,6 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; /// **key** - [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. /// Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. /// -/// **addTrackByDefault** - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] -/// -/// **controller** - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack -/// track functionalities on your own. -/// /// Refer [HMSVideoView guide here](https://www.100ms.live/docs/flutter/v2/features/render-video) class HMSVideoView extends StatelessWidget { /// This will render video with trackId present in the track @@ -59,13 +54,6 @@ class HMSVideoView extends StatelessWidget { /// [disableAutoSimulcastLayerSelect] - To disable auto simulcast (Adaptive Bitrate) final bool disableAutoSimulcastLayerSelect; - /// [addTrackByDefault] - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] - final bool addTrackByDefault; - - /// [controller] - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack - /// track functionalities on your own. - final HMSVideoViewController? controller; - ///100ms HMSVideoView /// ///HMSVideoView used to render video in ios and android devices @@ -100,9 +88,7 @@ class HMSVideoView extends StatelessWidget { "matchParent is not longer necessary and will be removed in future version") this.matchParent = true, this.scaleType = ScaleType.SCALE_ASPECT_FIT, - this.disableAutoSimulcastLayerSelect = false, - this.addTrackByDefault = true, - this.controller}) + this.disableAutoSimulcastLayerSelect = false}) : super(key: key); @override @@ -113,20 +99,17 @@ class HMSVideoView extends StatelessWidget { setMirror: setMirror, scaleType: this.scaleType, disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect, - addTrackByDefault: addTrackByDefault, - controller: controller, ); } } -class _PlatformView extends StatefulWidget { +class _PlatformView extends StatelessWidget { final HMSTrack track; + final bool setMirror; final bool matchParent; final ScaleType scaleType; final bool disableAutoSimulcastLayerSelect; - final bool addTrackByDefault; - final HMSVideoViewController? controller; _PlatformView( {Key? key, @@ -134,91 +117,42 @@ class _PlatformView extends StatefulWidget { this.setMirror = false, this.matchParent = true, required this.scaleType, - this.disableAutoSimulcastLayerSelect = false, - this.addTrackByDefault = true, - this.controller}) + this.disableAutoSimulcastLayerSelect = false}) : super(key: key); - @override - State<_PlatformView> createState() => _PlatformViewState(); -} - -class _PlatformViewState extends State<_PlatformView> { - HMSVideoViewController? viewController; - void onPlatformViewCreated(int id) {} - @override - void initState() { - if (widget.controller == null) { - viewController = - HMSVideoViewController(track: widget.track as HMSVideoTrack); - } else { - viewController = widget.controller; - } - viewController?.setCallbackMethod(setView); - super.initState(); - } - - void setView() { - if (mounted) { - setState(() {}); - } - } - - @override - void dispose() { - if (widget.controller == null) { - viewController?.disposeTextureView(); - } - super.dispose(); - } - @override Widget build(BuildContext context) { ///AndroidView for android it uses surfaceRenderer provided internally by webrtc. if (Platform.isAndroid) { - return viewController?.textureId == null - ? SizedBox() - : LayoutBuilder( - builder: (context, constraints) { - viewController?.setHeightWidth( - height: constraints.maxHeight, width: constraints.maxWidth); - return Center( - child: widget.scaleType != ScaleType.SCALE_ASPECT_FIT - ? Container( - width: constraints.maxWidth, - height: constraints.maxHeight, - child: HMSTextureView( - scaleType: widget.scaleType, - viewController: viewController, - constraints: constraints, - setMirror: widget.setMirror, - ), - ) - : HMSTextureView( - scaleType: widget.scaleType, - viewController: viewController, - constraints: constraints, - setMirror: widget.setMirror, - ), - ); - }, - ); + return AndroidView( + hitTestBehavior: PlatformViewHitTestBehavior.transparent, + viewType: 'HMSVideoView', + onPlatformViewCreated: onPlatformViewCreated, + creationParamsCodec: StandardMessageCodec(), + creationParams: { + 'track_id': track.trackId, + 'set_mirror': track.source != "REGULAR" ? false : setMirror, + 'scale_type': scaleType.value, + 'match_parent': matchParent, + 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect + }, + gestureRecognizers: {}, + ); } else if (Platform.isIOS) { ///UIKitView for ios it uses VideoView provided by 100ms ios_sdk internally. return UiKitView( + hitTestBehavior: PlatformViewHitTestBehavior.transparent, viewType: 'HMSFlutterPlatformView', onPlatformViewCreated: onPlatformViewCreated, creationParamsCodec: StandardMessageCodec(), creationParams: { - 'track_id': widget.track.trackId, - 'set_mirror': - widget.track.source != "REGULAR" ? false : widget.setMirror, - 'scale_type': widget.scaleType.value, - 'match_parent': widget.matchParent, - 'disable_auto_simulcast_layer_select': - widget.disableAutoSimulcastLayerSelect + 'track_id': track.trackId, + 'set_mirror': track.source != "REGULAR" ? false : setMirror, + 'scale_type': scaleType.value, + 'match_parent': matchParent, + 'disable_auto_simulcast_layer_select': disableAutoSimulcastLayerSelect }, gestureRecognizers: {}, ); @@ -228,39 +162,3 @@ class _PlatformViewState extends State<_PlatformView> { } } } - -class HMSTextureView extends StatelessWidget { - const HMSTextureView( - {Key? key, - required this.scaleType, - required this.viewController, - required this.constraints, - required this.setMirror}) - : super(key: key); - - final ScaleType scaleType; - final HMSVideoViewController? viewController; - final BoxConstraints constraints; - final bool setMirror; - - @override - Widget build(BuildContext context) { - return FittedBox( - clipBehavior: Clip.hardEdge, - fit: scaleType == ScaleType.SCALE_ASPECT_FIT - ? BoxFit.contain - : BoxFit.cover, - child: SizedBox( - width: (constraints.maxHeight * - ((viewController != null) ? viewController!.aspectRatio : 1)), - height: constraints.maxHeight, - child: Center( - child: Transform( - transform: Matrix4.identity()..rotateY(setMirror ? -pi : 0.0), - alignment: FractionalOffset.center, - child: Texture(textureId: viewController!.textureId!)), - ), - ), - ); - } -} From f16fff0af1c97d68dc4783bc38df7bb382d6a6a3 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 27 Nov 2023 16:56:49 +0530 Subject: [PATCH 24/53] Fixed screenshare bugs --- packages/hms_room_kit/example/pubspec.lock | 81 ++++++++---------- .../lib/src/meeting/meeting_store.dart | 3 + .../screen_share_grid_layout.dart | 45 +++++----- .../meeting_modes/custom_one_to_one_grid.dart | 17 ++-- packages/hms_room_kit/pubspec.lock | 81 ++++++++---------- packages/hms_room_kit/pubspec.yaml | 3 +- packages/hmssdk_flutter/example/pubspec.lock | 85 +++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 +++--- 8 files changed, 164 insertions(+), 177 deletions(-) diff --git a/packages/hms_room_kit/example/pubspec.lock b/packages/hms_room_kit/example/pubspec.lock index 68e6bec16..f0e5a3f38 100644 --- a/packages/hms_room_kit/example/pubspec.lock +++ b/packages/hms_room_kit/example/pubspec.lock @@ -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: @@ -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: @@ -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: @@ -395,58 +394,50 @@ 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: name: petitparser - sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "5.4.0" platform: dependency: transitive description: @@ -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: @@ -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: @@ -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: @@ -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: @@ -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: @@ -768,10 +759,10 @@ packages: dependency: transitive description: name: xml - sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.4.2" + version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 0af8113bb..5f2f7a68c 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1611,6 +1611,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(); diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart index fde25e41a..040f62533 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart @@ -73,13 +73,16 @@ class _ScreenshareGridLayoutState extends State { selector: (_, meetingStore) => meetingStore.currentScreenSharePage, builder: (_, currentScreenSharePage, __) { - return DotsIndicator( - dotsCount: widget.screenshareCount, - position: currentScreenSharePage, - decorator: DotsDecorator( - activeColor: - HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DotsIndicator( + dotsCount: widget.screenshareCount, + position: currentScreenSharePage, + decorator: DotsDecorator( + activeColor: + HMSThemeColors.onSurfaceHighEmphasis, + color: HMSThemeColors.onSurfaceLowEmphasis), + ), ); }), ) @@ -131,18 +134,22 @@ class _ScreenshareGridLayoutState extends State { builder: (_, currentPage, __) { return Padding( padding: const EdgeInsets.only(top: 8.0), - child: DotsIndicator( - dotsCount: (((widget.peerTracks.length - - widget.screenshareCount) ~/ - 2) + - (widget.peerTracks.length - - widget.screenshareCount) % - 2), - position: currentPage, - decorator: DotsDecorator( - activeColor: - HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), + child: SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DotsIndicator( + mainAxisSize: MainAxisSize.min, + dotsCount: (((widget.peerTracks.length - + widget.screenshareCount) ~/ + 2) + + (widget.peerTracks.length - + widget.screenshareCount) % + 2), + position: currentPage, + decorator: DotsDecorator( + activeColor: + HMSThemeColors.onSurfaceHighEmphasis, + color: HMSThemeColors.onSurfaceLowEmphasis), + ), ), ); }) diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index c1614b8c5..badde6fcb 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -111,13 +111,16 @@ class _CustomOneToOneGridState extends State { selector: (_, meetingStore) => meetingStore.currentPage, builder: (_, currentPage, __) { - return DotsIndicator( - dotsCount: pageCount, - position: currentPage, - decorator: DotsDecorator( - activeColor: - HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), + return SingleChildScrollView( + scrollDirection: Axis.horizontal, + child: DotsIndicator( + dotsCount: pageCount, + position: currentPage, + decorator: DotsDecorator( + activeColor: + HMSThemeColors.onSurfaceHighEmphasis, + color: HMSThemeColors.onSurfaceLowEmphasis), + ), ); }), ) diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index cb5be5991..06e6fbcdd 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -69,10 +69,10 @@ packages: dependency: "direct main" 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: @@ -211,11 +211,10 @@ packages: hmssdk_flutter: dependency: "direct main" 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: @@ -292,10 +291,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: @@ -380,58 +379,50 @@ packages: dependency: "direct main" 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: name: petitparser - sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "5.4.0" platform: dependency: transitive description: @@ -524,10 +515,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: @@ -561,18 +552,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: @@ -593,10 +584,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: "direct main" description: @@ -665,10 +656,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: @@ -729,10 +720,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: @@ -753,10 +744,10 @@ packages: dependency: transitive description: name: xml - sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.4.2" + version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index e58cefaa3..63141d884 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -14,7 +14,8 @@ dependencies: flutter: sdk: flutter - hmssdk_flutter: ^1.9.3 + hmssdk_flutter: + path: ../hmssdk_flutter intl: ^0.18.1 permission_handler: ^11.0.0 provider: ^6.0.5 diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 9fa43f469..6942aad89 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,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: @@ -298,11 +298,10 @@ packages: hmssdk_flutter: dependency: transitive description: - name: hmssdk_flutter - sha256: "70d00820ab5cb02c03c2d4f41be70dd9dc3406521a469b8989d1e650232efd9a" - url: "https://pub.dev" - source: hosted - version: "1.9.3" + path: ".." + relative: true + source: path + version: "1.9.4" http: dependency: transitive description: @@ -371,10 +370,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: @@ -395,10 +394,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "88bc797f44a94814f2213db1c9bd5badebafdfb8290ca9f78d4b9ee2a3db4d79" + sha256: "7e76fad405b3e4016cd39d08f455a4eb5199723cf594cd1b8916d47140d93017" url: "https://pub.dev" source: hosted - version: "5.0.1" + version: "4.2.0" package_info_plus_platform_interface: dependency: transitive description: @@ -475,58 +474,50 @@ 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: name: petitparser - sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.1" + version: "5.4.0" platform: dependency: transitive description: @@ -627,10 +618,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: @@ -664,18 +655,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: @@ -696,10 +687,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: @@ -792,10 +783,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: @@ -856,10 +847,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: @@ -880,10 +871,10 @@ packages: dependency: transitive description: name: xml - sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.4.2" + version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + dart: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 53939cd59..c3cc2c33e 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,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" fake_async: dependency: transitive description: @@ -79,10 +79,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" path: dependency: transitive description: @@ -108,18 +108,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: @@ -140,10 +140,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" vector_math: dependency: transitive description: @@ -156,10 +156,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" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From 54b1671bac1af6acd68c2c2bb9b153fc3890ee7b Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 27 Nov 2023 17:38:05 +0530 Subject: [PATCH 25/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?3=20(393)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hms_room_kit/lib/src/meeting/meeting_store.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 5f2f7a68c..6ea6a2601 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1074,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); @@ -1086,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 From 9bfbaf76a8bb1fa03b09282e9dd10c4be4b8bb56 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 27 Nov 2023 17:38:21 +0530 Subject: [PATCH 26/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?3=20(393)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 5236d4039..514fdd268 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 392 - versionName "1.5.92" + versionCode 393 + versionName "1.5.93" } signingConfigs { From c88964f5ff29a4d1a57b64d6618112038703017b Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Tue, 28 Nov 2023 18:54:47 +0530 Subject: [PATCH 27/53] FLUT-167: Fixed preview stretching bug (#1645) --- packages/hmssdk_flutter/android/build.gradle | 6 +++--- packages/hmssdk_flutter/example/ExampleAppChangelog.txt | 3 +++ packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index a6ecb3b16..6e8e2ed33 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -46,9 +46,9 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:flutter-blframe-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:flutter-blframe-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:lib:flutter-blframe-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:videoview:flutter-previewfix-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:flutter-previewfix-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:lib:flutter-previewfix-SNAPSHOT" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 7b1605122..7b950a1bc 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -3,6 +3,9 @@ Board: https://100ms.atlassian.net/jira/software/projects/FLUT/boards/34/ - Added TextureView in place of SurfaceView for better performance https://100ms.atlassian.net/browse/FLUT-121 +- Video on preview is stretched. +https://100ms.atlassian.net/browse/FLUT-167 + Room Kit: 1.0.7 Core SDK: 1.9.4 Android SDK: 2.8.1 diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 514fdd268..a802c1993 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 393 - versionName "1.5.93" + versionCode 394 + versionName "1.5.94" } signingConfigs { From 3d164369515c985f12430e4bf28a3648b4c00fb1 Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Wed, 29 Nov 2023 12:59:09 +0530 Subject: [PATCH 28/53] Fixed colored line issue in grid (#1646) --- .../src/widgets/common_widgets/peer_tile.dart | 43 ++++++------------- .../widgets/common_widgets/video_view.dart | 8 ++-- .../meeting_modes/custom_one_to_one_grid.dart | 3 +- 3 files changed, 18 insertions(+), 36 deletions(-) diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index d19d4ec7e..e00d3e25e 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -4,7 +4,6 @@ import 'dart:developer'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:focus_detector/focus_detector.dart'; -import 'package:hms_room_kit/src/widgets/peer_widgets/audio_level_avatar.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:provider/provider.dart'; @@ -94,14 +93,18 @@ class _PeerTileState extends State { "fl_${context.read().peer.name}_video_on", child: Stack( children: [ - VideoView( - uid: context.read().uid, - scaleType: widget.scaleType, - avatarTitleFontSize: widget.avatarTitleFontSize, - avatarRadius: widget.avatarRadius, - avatarTitleTextLineHeight: - widget.avatarTitleTextLineHeight, - videoViewController: widget.videoViewController, + ///ClipRRect is used to round the video edges + ClipRRect( + borderRadius: BorderRadius.circular(10), + child: VideoView( + uid: context.read().uid, + scaleType: widget.scaleType, + avatarTitleFontSize: widget.avatarTitleFontSize, + avatarRadius: widget.avatarRadius, + avatarTitleTextLineHeight: + widget.avatarTitleTextLineHeight, + videoViewController: widget.videoViewController, + ), ), Semantics( label: @@ -110,28 +113,6 @@ class _PeerTileState extends State { constraints: constraints, ), ), - Selector( - selector: (_, peerTrackNode) => - peerTrackNode.isOffscreen, - builder: (_, isOffScreen, __) { - return isOffScreen - ? Semantics( - label: "fl_video_off", - child: Container( - decoration: BoxDecoration( - color: - HMSThemeColors.backgroundDefault, - ), - child: AudioLevelAvatar( - avatarRadius: widget.avatarRadius, - avatarTitleFontSize: - widget.avatarTitleFontSize, - avatarTitleTextLineHeight: - widget.avatarTitleTextLineHeight, - ), - )) - : const SizedBox(); - }), NameAndNetwork(maxWidth: constraints.maxWidth), const HandRaise(), //top left const BRBTag(), //top left diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart index 09dfb7af0..c6c3234cd 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/video_view.dart @@ -56,11 +56,11 @@ class _VideoViewState extends State { @override Widget build(BuildContext context) { ///We use the [Selector] widget to rebuild the widget when the peer track node changes - return Selector>( + return Selector>( builder: (_, data, __) { ///If the peer track node is null or the peer is muted or the peer is offscreen ///We render the avatar - if ((data.item1 == null) || data.item2) { + if ((data.item1 == null) || data.item2 || data.item3) { return Semantics( label: "fl_video_off", child: AudioLevelAvatar( @@ -110,7 +110,7 @@ class _VideoViewState extends State { ); } }, - selector: (_, peerTrackNode) => - Tuple2(peerTrackNode.track, (peerTrackNode.track?.isMute ?? true))); + selector: (_, peerTrackNode) => Tuple3(peerTrackNode.track, + peerTrackNode.isOffscreen, (peerTrackNode.track?.isMute ?? true))); } } diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index badde6fcb..d2532abf4 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -119,7 +119,8 @@ class _CustomOneToOneGridState extends State { decorator: DotsDecorator( activeColor: HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), + color: + HMSThemeColors.onSurfaceLowEmphasis), ), ); }), From 9935263c78831945e6b8249e8feb3d13cc2a51cc Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 29 Nov 2023 13:12:49 +0530 Subject: [PATCH 29/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?5=20(395)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Podfile.lock | 10 +++++----- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index a802c1993..7939dd65b 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 394 - versionName "1.5.94" + versionCode 395 + versionName "1.5.95" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Podfile.lock b/packages/hmssdk_flutter/example/ios/Podfile.lock index 523d413f9..a1e7961d0 100644 --- a/packages/hmssdk_flutter/example/ios/Podfile.lock +++ b/packages/hmssdk_flutter/example/ios/Podfile.lock @@ -79,7 +79,7 @@ PODS: - Flutter (1.0.0) - flutter_foreground_task (0.0.1): - Flutter - - GoogleDataTransport (9.2.5): + - GoogleDataTransport (9.3.0): - GoogleUtilities/Environment (~> 7.7) - nanopb (< 2.30910.0, >= 2.30908.0) - PromisesObjC (< 3.0, >= 1.2) @@ -100,7 +100,7 @@ PODS: - HMSSDK (1.3.0): - HMSAnalyticsSDK (= 0.0.2) - HMSWebRTC (= 1.0.5116) - - hmssdk_flutter (1.9.3): + - hmssdk_flutter (1.9.4): - Flutter - HMSBroadcastExtensionSDK (= 0.0.9) - HMSHLSPlayerSDK (= 0.0.2) @@ -230,13 +230,13 @@ SPEC CHECKSUMS: FirebaseSharedSwift: 62e248642c0582324d0390706cadd314687c116b Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_foreground_task: 21ef182ab0a29a3005cc72cd70e5f45cb7f7f817 - GoogleDataTransport: 54dee9d48d14580407f8f5fbf2f496e92437a2f2 + GoogleDataTransport: 57c22343ab29bc686febbf7cbb13bad167c2d8fe GoogleUtilities: 0759d1a57ebb953965c2dfe0ba4c82e95ccc2e34 HMSAnalyticsSDK: 4d2a88a729b1eb42f3d25f217c28937ec318a5b7 HMSBroadcastExtensionSDK: d80fe325f6c928bd8e5176290b5a4b7ae15d6fbb HMSHLSPlayerSDK: 6a54ad4d12f3dc2270d1ecd24019d71282a4f6a3 HMSSDK: 631908d772646b66b3c4f7f4e1fb2681f7abb990 - hmssdk_flutter: 0b17359aefb7ec222e1b0cc44a595759a317ff98 + hmssdk_flutter: ce3c54bbda2a8e1d893be672a877510a546da012 HMSWebRTC: ae54e9dd91b869051b283b43b14f57d43b7bf8e1 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb nanopb: d4d75c12cd1316f4a64e3c6963f879ecd4b5e0d5 @@ -253,4 +253,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 919064996fff867cd85dbf9e7730ff45bac23884 -COCOAPODS: 1.14.3 +COCOAPODS: 1.13.0 diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 03adab0f8..6e7bd14a7 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.92 + 1.5.95 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 392 + 395 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 6282b7b2609866f52da3ab9809fb7bac56c52ae3 Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Thu, 30 Nov 2023 15:55:35 +0530 Subject: [PATCH 30/53] Fixed iOS streal url fix (#1647) --- .../ios/Classes/Models/HMSHLSVariantExtension.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/hmssdk_flutter/ios/Classes/Models/HMSHLSVariantExtension.swift b/packages/hmssdk_flutter/ios/Classes/Models/HMSHLSVariantExtension.swift index ce7ffb2ff..8d9e71ffc 100644 --- a/packages/hmssdk_flutter/ios/Classes/Models/HMSHLSVariantExtension.swift +++ b/packages/hmssdk_flutter/ios/Classes/Models/HMSHLSVariantExtension.swift @@ -18,7 +18,12 @@ class HMSHLSVariantExtension { dict["metadata"] = hmshlsVariant.metadata - dict["hls_stream_url"] = hmshlsVariant.url?.absoluteString + if let url = hmshlsVariant.url{ + dict["hls_stream_url"] = url.absoluteString + } + else{ + dict["hls_stream_url"] = nil + } if let startedAt = hmshlsVariant.startedAt { dict["started_at"] = "\(startedAt)" From 88aabe6ae300f7bd8a245e07f08adc15922a0cfe Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 30 Nov 2023 16:07:30 +0530 Subject: [PATCH 31/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?6=20(396)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/ExampleAppChangelog.txt | 3 +++ packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Podfile.lock | 2 +- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 7b950a1bc..9b2329c70 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -6,6 +6,9 @@ https://100ms.atlassian.net/browse/FLUT-121 - Video on preview is stretched. https://100ms.atlassian.net/browse/FLUT-167 +- when swiping page, there’s tile colored line between tiles. +https://100ms.atlassian.net/browse/FLUT-166 + Room Kit: 1.0.7 Core SDK: 1.9.4 Android SDK: 2.8.1 diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 7939dd65b..3b1ba36e8 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 395 - versionName "1.5.95" + versionCode 396 + versionName "1.5.96" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Podfile.lock b/packages/hmssdk_flutter/example/ios/Podfile.lock index a1e7961d0..5ee7a9fc4 100644 --- a/packages/hmssdk_flutter/example/ios/Podfile.lock +++ b/packages/hmssdk_flutter/example/ios/Podfile.lock @@ -253,4 +253,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 919064996fff867cd85dbf9e7730ff45bac23884 -COCOAPODS: 1.13.0 +COCOAPODS: 1.14.3 diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 6e7bd14a7..dbdc6cdfa 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.95 + 1.5.96 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 395 + 396 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 00cd6999b30406a56f1402a3f8176abc061b9c73 Mon Sep 17 00:00:00 2001 From: ygit Date: Thu, 30 Nov 2023 14:50:49 +0000 Subject: [PATCH 32/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/pubspec.lock | 26 ++++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 ++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 6942aad89..841b668e7 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -370,10 +370,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -655,18 +655,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -687,10 +687,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: transitive description: @@ -847,10 +847,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: @@ -876,5 +876,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index c3cc2c33e..53939cd59 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -79,10 +79,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -108,18 +108,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -140,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.10.0" From f133c1710bf81db0a509d0284ad5c005820ba086 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 1 Dec 2023 14:39:21 +0530 Subject: [PATCH 33/53] Updated android sdk version to 2.8.2 --- packages/hmssdk_flutter/android/build.gradle | 9 +++------ .../hmssdk_flutter/example/ExampleAppChangelog.txt | 4 +++- .../hmssdk_flutter/lib/assets/sdk-versions.json | 2 +- .../lib/src/ui/meeting/hms_texture_view.dart | 4 ++-- .../src/ui/meeting/hms_texture_view_controller.dart | 13 ++----------- 5 files changed, 11 insertions(+), 21 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 6e8e2ed33..019e12a8a 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -43,12 +43,9 @@ android { } dependencies { -// implementation "live.100ms:android-sdk:${sdkVersions['android']}" -// implementation "live.100ms:video-view:${sdkVersions['android']}" -// implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:flutter-previewfix-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:flutter-previewfix-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:lib:flutter-previewfix-SNAPSHOT" + implementation "live.100ms:android-sdk:${sdkVersions['android']}" + implementation "live.100ms:video-view:${sdkVersions['android']}" + implementation "live.100ms:hls-player:${sdkVersions['android']}" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 9b2329c70..603563cbb 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -9,7 +9,9 @@ https://100ms.atlassian.net/browse/FLUT-167 - when swiping page, there’s tile colored line between tiles. https://100ms.atlassian.net/browse/FLUT-166 +RC build + Room Kit: 1.0.7 Core SDK: 1.9.4 -Android SDK: 2.8.1 +Android SDK: 2.8.2 iOS SDK: 1.3.0 diff --git a/packages/hmssdk_flutter/lib/assets/sdk-versions.json b/packages/hmssdk_flutter/lib/assets/sdk-versions.json index d1b515281..b5bbcad61 100644 --- a/packages/hmssdk_flutter/lib/assets/sdk-versions.json +++ b/packages/hmssdk_flutter/lib/assets/sdk-versions.json @@ -3,5 +3,5 @@ "ios": "1.3.0", "iOSBroadcastExtension": "0.0.9", "iOSHLSPlayerSDK": "0.0.2", - "android": "2.8.1" + "android": "2.8.2" } diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart index 5d266d800..90c2985af 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart @@ -11,7 +11,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; ///100ms HMSTextureView /// -///HMSTextureView used to render video in ios and android devices +///HMSTextureView is used to render video tracks /// ///In android devices, [HMSTextureView] uses texture to render videos while [HMSVideoView] uses surfaceView to render videos. ///In iOS there is no difference between [HMSTextureView] and [HMSVideoView]. @@ -38,7 +38,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; /// **controller** - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack /// track functionalities on your own. /// -/// Refer [HMSVideoView guide here](https://www.100ms.live/docs/flutter/v2/features/render-video) +/// Refer [HMSTextureView guide here](https://www.100ms.live/docs/flutter/v2/features/render-video) class HMSTextureView extends StatelessWidget { /// This will render video with trackId present in the track /// [track] - the video track to be displayed diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart index 01c918768..14e194839 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart @@ -1,6 +1,3 @@ -///Dart imports -import 'dart:developer'; - ///Package imports import 'package:flutter/services.dart'; @@ -51,7 +48,6 @@ class HMSTextureViewController { {HMSTrack? track, bool addTrackByDefault = true, bool? disableAutoSimulcastLayerSelect}) async { - log("VKohli Calling createTextureView -> disableAutoSimulcastLayerSelect:$disableAutoSimulcastLayerSelect height: $_height, width: $_width"); var result = await PlatformService.invokeMethod( PlatformMethod.createTextureView, arguments: { @@ -74,15 +70,13 @@ class HMSTextureViewController { ///[setCallbackMethod] is used to set the callback method for the texture view. ///This callback method is used to refresh the view when certain properties of the view changes. void setCallbackMethod(Function callback) { - log("VKohli Calling setCallbackMethod -> $callback"); - _updateViewCallback = callback; + _updateViewCallback = callback; } ///[disposeTextureView] is used to dispose the texture view. ///It is the responsibility of the application to dispose the texture view if the controller is created ///by the application. void disposeTextureView() async { - log("VKohli Calling disposeTextureView"); var result = await PlatformService.invokeMethod( PlatformMethod.disposeTextureView, arguments: {"texture_id": textureId.toString()}); @@ -96,7 +90,6 @@ class HMSTextureViewController { void addTrack( {required HMSVideoTrack track, bool? disableAutoSimulcastLayerSelect}) async { - log("VKohli Calling addTrack -> height: $_height, width: $_width"); await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { "track_id": track.trackId, "texture_id": textureId.toString(), @@ -127,7 +120,6 @@ class HMSTextureViewController { ///[setHeightWidth] is used to set the height and width of the texture view. void setHeightWidth({required double height, required double width}) { if (_height != height.toInt() || _width != width.toInt()) { - log("VKohli Calling setHeightWidth-> height: $height, width: $width"); _height = height.toInt(); _width = width.toInt(); _setDisplayResolution(height: _height!, width: _width!); @@ -137,8 +129,7 @@ class HMSTextureViewController { ///[_eventListener] is the callback method for the texture view. ///We get the native callbacks like [onResolutionChanged] from the texture view. void _eventListener(dynamic event) { - log("VKohli HMSVideoView Event Fired $event"); - + HMSVideoViewEvent videoViewEvent = HMSVideoViewValues.getHMSVideoViewEventFromString(event['event_name']); switch (videoViewEvent) { From 399adde4aa840fb66723e66fa150bfcc3183cb8c Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 1 Dec 2023 09:11:09 +0000 Subject: [PATCH 34/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/src/ui/meeting/hms_texture_view_controller.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart index 14e194839..f768d406d 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart @@ -70,7 +70,7 @@ class HMSTextureViewController { ///[setCallbackMethod] is used to set the callback method for the texture view. ///This callback method is used to refresh the view when certain properties of the view changes. void setCallbackMethod(Function callback) { - _updateViewCallback = callback; + _updateViewCallback = callback; } ///[disposeTextureView] is used to dispose the texture view. @@ -129,7 +129,6 @@ class HMSTextureViewController { ///[_eventListener] is the callback method for the texture view. ///We get the native callbacks like [onResolutionChanged] from the texture view. void _eventListener(dynamic event) { - HMSVideoViewEvent videoViewEvent = HMSVideoViewValues.getHMSVideoViewEventFromString(event['event_name']); switch (videoViewEvent) { From 55904ff1808ecdad40c222d6270879495a9bf371 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 1 Dec 2023 17:31:50 +0530 Subject: [PATCH 35/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?7=20(397)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/android/app/build.gradle | 4 +-- .../example/ios/Runner/Info.plist | 4 +-- packages/hmssdk_flutter/example/pubspec.lock | 26 +++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 3b1ba36e8..0c79587ea 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 396 - versionName "1.5.96" + versionCode 397 + versionName "1.5.97" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index dbdc6cdfa..eff6a1ea4 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.96 + 1.5.97 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 396 + 397 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 841b668e7..6942aad89 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,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: @@ -370,10 +370,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: @@ -655,18 +655,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: @@ -687,10 +687,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: @@ -847,10 +847,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: @@ -876,5 +876,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 53939cd59..c3cc2c33e 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,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" fake_async: dependency: transitive description: @@ -79,10 +79,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" path: dependency: transitive description: @@ -108,18 +108,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: @@ -140,10 +140,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" vector_math: dependency: transitive description: @@ -156,10 +156,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" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From c599d8ad3d142860ffb2a0a6b8e5c7c48ca6e5a1 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Fri, 1 Dec 2023 12:03:33 +0000 Subject: [PATCH 36/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/pubspec.lock | 26 ++++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 ++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 6942aad89..841b668e7 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -370,10 +370,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -655,18 +655,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -687,10 +687,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: transitive description: @@ -847,10 +847,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: @@ -876,5 +876,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index c3cc2c33e..53939cd59 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -79,10 +79,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -108,18 +108,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -140,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.10.0" From 1a772cb1c41c103f3948ff1696a282cc79ca5b7d Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Sun, 3 Dec 2023 14:05:39 +0530 Subject: [PATCH 37/53] Fixed iOS crash with texture view (#1649) --- .../lib/src/meeting/meeting_store.dart | 2 +- .../screen_share_grid_layout.dart | 16 +-- .../meeting_modes/custom_one_to_one_grid.dart | 3 +- .../lib/src/ui/meeting/hms_texture_view.dart | 26 +++-- .../meeting/hms_texture_view_controller.dart | 107 +++++++++++------- 5 files changed, 94 insertions(+), 60 deletions(-) diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 6ea6a2601..e6b7a1467 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1005,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(); diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart index 040f62533..92b4430f9 100644 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart +++ b/packages/hms_room_kit/lib/src/widgets/grid_layouts/screen_share_grid_layout.dart @@ -132,19 +132,21 @@ class _ScreenshareGridLayoutState extends State { Selector( selector: (_, meetingStore) => meetingStore.currentPage, builder: (_, currentPage, __) { + int dotsCount = (((widget.peerTracks.length - + widget.screenshareCount) ~/ + 2) + + (widget.peerTracks.length - + widget.screenshareCount) % + 2); return Padding( padding: const EdgeInsets.only(top: 8.0), child: SingleChildScrollView( scrollDirection: Axis.horizontal, child: DotsIndicator( mainAxisSize: MainAxisSize.min, - dotsCount: (((widget.peerTracks.length - - widget.screenshareCount) ~/ - 2) + - (widget.peerTracks.length - - widget.screenshareCount) % - 2), - position: currentPage, + dotsCount: dotsCount, + position: + currentPage > dotsCount ? 0 : currentPage, decorator: DotsDecorator( activeColor: HMSThemeColors.onSurfaceHighEmphasis, diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index d2532abf4..db5064ed4 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -115,7 +115,8 @@ class _CustomOneToOneGridState extends State { scrollDirection: Axis.horizontal, child: DotsIndicator( dotsCount: pageCount, - position: currentPage, + position: + currentPage > pageCount ? 0 : currentPage, decorator: DotsDecorator( activeColor: HMSThemeColors.onSurfaceHighEmphasis, diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart index 90c2985af..26145fae5 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart @@ -116,15 +116,18 @@ class _PlatformViewState extends State<_PlatformView> { void initState() { ///If controller is null, then we create a new controller ///else we use the controller provided by the app. - if (widget.controller == null) { - viewController = - HMSTextureViewController(track: widget.track as HMSVideoTrack); - } else { - viewController = widget.controller; + /// (Android Only) + if (Platform.isAndroid) { + if (widget.controller == null) { + viewController = + HMSTextureViewController(track: widget.track as HMSVideoTrack); + } else { + viewController = widget.controller; + } + + ///Here we set the callback method which gets called to set the view + viewController?.setCallbackMethod(setView); } - - ///Here we set the callback method which gets called to set the view - viewController?.setCallbackMethod(setView); super.initState(); } @@ -141,8 +144,11 @@ class _PlatformViewState extends State<_PlatformView> { /// ///Note that if the controller is created from app ///then the application needs to call this method explicitly. - if (widget.controller == null) { - viewController?.disposeTextureView(); + /// (Android Only) + if (Platform.isAndroid) { + if (widget.controller == null) { + viewController?.disposeTextureView(); + } } super.dispose(); } diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart index f768d406d..25477b271 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view_controller.dart @@ -1,3 +1,6 @@ +///Dart imports +import 'dart:io'; + ///Package imports import 'package:flutter/services.dart'; @@ -6,6 +9,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; import 'package:hmssdk_flutter/src/enum/hms_video_view_event.dart'; import 'package:hmssdk_flutter/src/service/platform_service.dart'; +/// (Android Only) ///[HMSTextureViewController] is used to control the video view. It helps in controlling addTrack, removeTrack functionalities manually. ///It is useful in custom usecases where you wish to control the addTrack and removeTrack functionalities on your own. ///Please note that if you control the view creation, addTrack etc. on application, then application has the responsibility @@ -40,6 +44,7 @@ class HMSTextureViewController { disableAutoSimulcastLayerSelect: disableAutoSimulcastLayerSelect); } + /// (Android Only) ///[createTextureView] is used to create the texture view. It takes [track] as an optional parameter. ///If [track] is provided, then it will add the track to the texture view by default. ///If [addTrackByDefault] is set to true, then it will add the track to the texture view by default. @@ -48,81 +53,101 @@ class HMSTextureViewController { {HMSTrack? track, bool addTrackByDefault = true, bool? disableAutoSimulcastLayerSelect}) async { - var result = await PlatformService.invokeMethod( - PlatformMethod.createTextureView, - arguments: { - "track_id": track?.trackId, - "add_track_by_def": addTrackByDefault, - "disable_auto_simulcast_layer_select": - disableAutoSimulcastLayerSelect ?? false - }); - if (result["success"]) { - _textureId = result["data"]["texture_id"]; - EventChannel('HMSTextureView/Texture/$textureId') - .receiveBroadcastStream() - .listen(_eventListener); - if (_updateViewCallback != null) { - _updateViewCallback!(); + if (Platform.isAndroid) { + var result = await PlatformService.invokeMethod( + PlatformMethod.createTextureView, + arguments: { + "track_id": track?.trackId, + "add_track_by_def": addTrackByDefault, + "disable_auto_simulcast_layer_select": + disableAutoSimulcastLayerSelect ?? false + }); + if (result["success"]) { + _textureId = result["data"]["texture_id"]; + EventChannel('HMSTextureView/Texture/$textureId') + .receiveBroadcastStream() + .listen(_eventListener); + if (_updateViewCallback != null) { + _updateViewCallback!(); + } } } } + /// (Android Only) ///[setCallbackMethod] is used to set the callback method for the texture view. ///This callback method is used to refresh the view when certain properties of the view changes. void setCallbackMethod(Function callback) { - _updateViewCallback = callback; + if (Platform.isAndroid) { + _updateViewCallback = callback; + } } + /// (Android Only) ///[disposeTextureView] is used to dispose the texture view. ///It is the responsibility of the application to dispose the texture view if the controller is created ///by the application. void disposeTextureView() async { - var result = await PlatformService.invokeMethod( - PlatformMethod.disposeTextureView, - arguments: {"texture_id": textureId.toString()}); - if (result["success"]) { - _textureId = null; + if (Platform.isAndroid) { + var result = await PlatformService.invokeMethod( + PlatformMethod.disposeTextureView, + arguments: {"texture_id": textureId.toString()}); + if (result["success"]) { + _textureId = null; + } } } + /// (Android Only) ///[addTrack] is used to add the track to the texture view. ///If [disableAutoSimulcastLayerSelect] is set to true, then it will disable the auto simulcast layer selection. void addTrack( {required HMSVideoTrack track, bool? disableAutoSimulcastLayerSelect}) async { - await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { - "track_id": track.trackId, - "texture_id": textureId.toString(), - "disable_auto_simulcast_layer_select": - disableAutoSimulcastLayerSelect ?? false, - "height": _height, - "width": _width - }); + if (Platform.isAndroid) { + await PlatformService.invokeMethod(PlatformMethod.addTrack, arguments: { + "track_id": track.trackId, + "texture_id": textureId.toString(), + "disable_auto_simulcast_layer_select": + disableAutoSimulcastLayerSelect ?? false, + "height": _height, + "width": _width + }); + } } + /// (Android Only) ///[_setDisplayResolution] is used to set the display resolution of the texture view. ///It is used internally by the SDK. void _setDisplayResolution({required int height, required int width}) { - PlatformService.invokeMethod(PlatformMethod.setDisplayResolution, - arguments: { - "texture_id": textureId.toString(), - "height": height, - "width": width - }); + if (Platform.isAndroid) { + PlatformService.invokeMethod(PlatformMethod.setDisplayResolution, + arguments: { + "texture_id": textureId.toString(), + "height": height, + "width": width + }); + } } + /// (Android Only) ///[removeTrack] is used to remove the track from the texture view. void removeTrack() { - PlatformService.invokeMethod(PlatformMethod.removeTrack, - arguments: {"texture_id": textureId.toString()}); + if (Platform.isAndroid) { + PlatformService.invokeMethod(PlatformMethod.removeTrack, + arguments: {"texture_id": textureId.toString()}); + } } + /// (Android Only) ///[setHeightWidth] is used to set the height and width of the texture view. void setHeightWidth({required double height, required double width}) { - if (_height != height.toInt() || _width != width.toInt()) { - _height = height.toInt(); - _width = width.toInt(); - _setDisplayResolution(height: _height!, width: _width!); + if (Platform.isAndroid) { + if (_height != height.toInt() || _width != width.toInt()) { + _height = height.toInt(); + _width = width.toInt(); + _setDisplayResolution(height: _height!, width: _width!); + } } } From 75922ecfcb561dd9c45bee966e3f486b10d056a2 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 4 Dec 2023 14:47:08 +0530 Subject: [PATCH 38/53] =?UTF-8?q?released=20sample=20app=20version=201.5.9?= =?UTF-8?q?8=20(398)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../example/android/app/build.gradle | 4 +-- .../example/ios/Runner/Info.plist | 4 +-- packages/hmssdk_flutter/example/pubspec.lock | 26 +++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 +++++++++---------- 4 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 0c79587ea..91546b5d0 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 397 - versionName "1.5.97" + versionCode 398 + versionName "1.5.98" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index eff6a1ea4..ded573211 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.97 + 1.5.98 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 397 + 398 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 841b668e7..6942aad89 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,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: @@ -370,10 +370,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: @@ -655,18 +655,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: @@ -687,10 +687,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: @@ -847,10 +847,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: @@ -876,5 +876,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 53939cd59..c3cc2c33e 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,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" fake_async: dependency: transitive description: @@ -79,10 +79,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" path: dependency: transitive description: @@ -108,18 +108,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: @@ -140,10 +140,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" vector_math: dependency: transitive description: @@ -156,10 +156,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" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From 13e1de9e40a92d383643f175c3ef159795b90786 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Mon, 4 Dec 2023 09:18:45 +0000 Subject: [PATCH 39/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/pubspec.lock | 26 ++++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 ++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 6942aad89..841b668e7 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -77,10 +77,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -370,10 +370,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -655,18 +655,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -687,10 +687,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: transitive description: @@ -847,10 +847,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: @@ -876,5 +876,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index c3cc2c33e..53939cd59 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -79,10 +79,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -108,18 +108,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -140,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.10.0" From 0e1235002ce763e43c83adc633a9c8b24e18b603 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 5 Dec 2023 09:49:35 +0000 Subject: [PATCH 40/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/pubspec.lock | 2 +- .../lib/flutter_flow/flutter_flow_util.dart | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index 643d5c65e..f81a063e2 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -876,5 +876,5 @@ packages: source: hosted version: "6.5.0" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.2.0 <4.0.0" flutter: ">=3.13.0" diff --git a/sample apps/flutterflow-prebuilt-quickstart/lib/flutter_flow/flutter_flow_util.dart b/sample apps/flutterflow-prebuilt-quickstart/lib/flutter_flow/flutter_flow_util.dart index fc761f396..2fa272d70 100644 --- a/sample apps/flutterflow-prebuilt-quickstart/lib/flutter_flow/flutter_flow_util.dart +++ b/sample apps/flutterflow-prebuilt-quickstart/lib/flutter_flow/flutter_flow_util.dart @@ -10,7 +10,6 @@ import 'package:url_launcher/url_launcher.dart'; import '../main.dart'; - export 'lat_lng.dart'; export 'place.dart'; export 'uploaded_file.dart'; From 8571f9bc4e66afacb68f7a7d4b83b17c34673003 Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:26:26 +0530 Subject: [PATCH 41/53] Fixed activeSpeaker layout while screenshare (#1650) --- .../lib/src/meeting/meeting_page.dart | 4 +- .../lib/src/meeting/meeting_store.dart | 15 +- .../grid_layouts/texture_view_grid.dart | 30 -- .../meeting_modes/custom_grid_view.dart | 313 ------------------ .../meeting_modes/custom_one_to_one_grid.dart | 12 +- .../meeting_modes/one_to_one_mode.dart | 7 +- packages/hmssdk_flutter/android/build.gradle | 9 +- 7 files changed, 30 insertions(+), 360 deletions(-) delete mode 100644 packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart delete mode 100644 packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_page.dart b/packages/hms_room_kit/lib/src/meeting/meeting_page.dart index 5bbc81f4d..e4d869fa2 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_page.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_page.dart @@ -292,9 +292,11 @@ class _MeetingPageState extends State { context: context, size: size) - : const CustomOneToOneGrid( + : CustomOneToOneGrid( isLocalInsetPresent: false, + peerTracks: + data.item1, ), )); }); diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index e6b7a1467..15237b08b 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1051,10 +1051,21 @@ class MeetingStore extends ChangeNotifier @override void onUpdateSpeakers({required List updateSpeakers}) { //To handle the active speaker mode scenario + + ///This is to handle whether to bring the user to first index + ///In case of normal layout if the user is on the first page i.e + ///index < 6 we don't move the peer to first page. Similarly, if + ///screenshare is on and index < 2 we don't update the position + ///of the peer + int peersInActiveSpeakerLayout = 6; + if (screenShareCount > 0) { + peersInActiveSpeakerLayout = 2; + } + if ((currentPage == 0) && (meetingMode == MeetingMode.activeSpeakerWithInset || meetingMode == MeetingMode.activeSpeakerWithoutInset) && - peerTracks.length > 6) { + peerTracks.length > peersInActiveSpeakerLayout) { /* Here we iterate through the updateSpeakers list * and do the following: * Find the index of the peer @@ -1064,7 +1075,7 @@ class MeetingStore extends ChangeNotifier for (var speaker in updateSpeakers) { int index = peerTracks.indexWhere((previousSpeaker) => previousSpeaker.uid == "${speaker.peer.peerId}mainVideo"); - if (index > 5) { + if (index > (peersInActiveSpeakerLayout - 1)) { PeerTrackNode activeSpeaker = peerTracks[index]; peerTracks.removeAt(index); peerTracks.insert(screenShareCount, activeSpeaker); diff --git a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart b/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart deleted file mode 100644 index dae0af083..000000000 --- a/packages/hms_room_kit/lib/src/widgets/grid_layouts/texture_view_grid.dart +++ /dev/null @@ -1,30 +0,0 @@ -import 'package:flutter/cupertino.dart'; -import 'package:hms_room_kit/src/model/peer_track_node.dart'; -import 'package:hms_room_kit/src/widgets/grid_layouts/listenable_peer_widget.dart'; - -class TextureViewGrid extends StatefulWidget { - final List peerTracks; - const TextureViewGrid({super.key, required this.peerTracks}); - - @override - State createState() => _TextureViewGridState(); -} - -class _TextureViewGridState extends State { - @override - Widget build(BuildContext context) { - return GridView.builder( - scrollDirection: Axis.horizontal, - physics: const PageScrollPhysics(), - gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 3, - mainAxisExtent: MediaQuery.of(context).size.width / 2), - itemCount: widget.peerTracks.length, - itemBuilder: (context, index) { - return ListenablePeerWidget( - peerTracks: widget.peerTracks, - index: index, - ); - }); - } -} diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart deleted file mode 100644 index 186c11295..000000000 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_grid_view.dart +++ /dev/null @@ -1,313 +0,0 @@ -///Package imports -import 'package:dots_indicator/dots_indicator.dart'; -import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; -import 'package:tuple/tuple.dart'; - -///Project imports -import 'package:hms_room_kit/hms_room_kit.dart'; -import 'package:hms_room_kit/src/meeting/meeting_store.dart'; -import 'package:hms_room_kit/src/model/peer_track_node.dart'; -import 'package:hms_room_kit/src/widgets/common_widgets/peer_tile.dart'; - -///This widget renders the grid view of the meeting screen without inset tile -///The grid view is rendered based on the number of peers in the meeting -///The grid view is rendered using the [PageView] widget -class CustomGridView extends StatefulWidget { - const CustomGridView({super.key}); - - @override - State createState() => _CustomGridViewState(); -} - -class _CustomGridViewState extends State { - PageController controller = PageController(); - int tileNumber = 0; - - @override - Widget build(BuildContext context) { - ///The grid view is rendered using the [PageView] widget - ///The number of pages in the [PageView] is equal to [numberOfPeers/6 + (if number of peers is not divisible by 6 then we add 1 else we add 0)] - return Selector, int, int>>( - selector: (_, meetingStore) => Tuple3(meetingStore.peerTracks, - meetingStore.peerTracks.length, meetingStore.currentPage), - builder: (_, data, __) { - int pageCount = (data.item2 ~/ 6) + (data.item2 % 6 == 0 ? 0 : 1); - return Column( - children: [ - Expanded( - child: PageView.builder( - physics: const PageScrollPhysics(), - scrollDirection: Axis.horizontal, - controller: controller, - allowImplicitScrolling: true, - itemCount: pageCount, - onPageChanged: (newPage) { - context.read().setCurrentPage(newPage); - }, - itemBuilder: (context, index) => - _generateGrid(data.item2, index, data.item1)), - ), - - ///This renders the dots at the bottom of the grid view - ///This is only rendered if the number of pages is greater than 1 - ///The number of dots is equal to [numberOfPeers/6 + (if number of peers is not divisible by 6 then we add 1 else we add 0)] - ///The active dot is the current page - ///The inactive dots are the pages other than the current page - if (pageCount > 1) - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: DotsIndicator( - dotsCount: - (data.item2 ~/ 6) + (data.item2 % 6 == 0 ? 0 : 1), - position: data.item3, - decorator: DotsDecorator( - activeColor: HMSThemeColors.onSurfaceHighEmphasis, - color: HMSThemeColors.onSurfaceLowEmphasis), - ), - ) - ], - ); - }); - } - - ///This function generates the grid view based on the number of peers in the meeting - Widget _generateGrid( - int numberOfTiles, int index, List peerTrackNode) { - int tileToBeRendered = 0; - - ///Here we check how many tiles we need to render - ///So if still there are 6 or more tiles to be rendered then we render 6 tiles - ///else we render the remaining tiles - /// - ///This is done to decide which layout we need to render - if ((6 * (index + 1) > numberOfTiles)) { - tileToBeRendered = numberOfTiles - 6 * (index); - } else { - tileToBeRendered = 6; - } - - ///This contains the starting index of tile to be rendered - tileNumber = 6 * index; - - ///Here we render the tile layout based on how many tiles we need to render - ///If we need to render 1 tile then we render the [ListenablePeerWidget] - ///If we need to render 2 tiles then we render the [TwoTileLayout] - ///If we need to render 3 tiles then we render the [ThreeTileLayout] - ///If we need to render 4 tiles then we render the [FourTileLayout] - ///If we need to render 5 tiles then we render the [FiveTileLayout] - ///If we need to render 6 tiles then we render the [SixTileLayout] - if (tileToBeRendered == 6) { - return sixTileLayout(peerTrackNode); - } - switch (tileToBeRendered % 6) { - case 1: - return singleTileLayout(peerTrackNode); - - case 2: - return twoTileLayout(peerTrackNode); - - case 3: - return threeTileLayout(peerTrackNode); - - case 4: - return fourTileLayout(peerTrackNode); - - case 5: - return fiveTileLayout(peerTrackNode); - } - return sixTileLayout(peerTrackNode); - } - - Widget sixTileLayout(List peerTracks) { - return Column( - children: [ - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 1, peerTracks)), - ) - ]), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber + 2, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 3, peerTracks)), - ) - ]), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber + 4, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 5, peerTracks)), - ) - ]), - ), - ], - ); - } - - Widget fiveTileLayout(List peerTracks) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 1, peerTracks)), - ), - ]), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber + 2, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 3, peerTracks)), - ), - ]), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: MediaQuery.of(context).size.width / 4), - child: Container( - child: peerWidget(tileNumber + 4, peerTracks), - ), - ), - ), - ], - ); - } - - Widget fourTileLayout(List peerTracks) { - return Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 1, peerTracks)), - ), - ]), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Row(children: [ - Expanded( - child: Container(child: peerWidget(tileNumber + 2, peerTracks)), - ), - const SizedBox( - width: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 3, peerTracks)), - ), - ]), - ), - ], - ); - } - - Widget threeTileLayout(List peerTracks) { - return Column( - children: [ - Expanded( - child: Container(child: peerWidget(tileNumber, peerTracks)), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 1, peerTracks)), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 2, peerTracks)), - ), - ], - ); - } - - Widget twoTileLayout(List peerTracks) { - return SizedBox( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Container(child: peerWidget(tileNumber, peerTracks)), - ), - const SizedBox( - height: 8, - ), - Expanded( - child: Container(child: peerWidget(tileNumber + 1, peerTracks)), - ), - ], - ), - ); - } - - Widget singleTileLayout(List peerTracks) { - return Container(child: peerWidget(tileNumber, peerTracks)); - } - - Widget peerWidget(int index, List peerTracks) { - return ChangeNotifierProvider.value( - key: ValueKey("${peerTracks[index].uid}video_view"), - value: peerTracks[index], - child: PeerTile( - key: ValueKey("${peerTracks[index].uid}audio_view"), - )); - } -} diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart index db5064ed4..0cfbd7e82 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/custom_one_to_one_grid.dart @@ -18,7 +18,9 @@ import 'package:hms_room_kit/src/widgets/grid_layouts/screen_share_grid_layout.d ///[isLocalInsetPresent] is used to check if the local inset tile is present or not class CustomOneToOneGrid extends StatefulWidget { final bool isLocalInsetPresent; - const CustomOneToOneGrid({super.key, this.isLocalInsetPresent = true}); + final List? peerTracks; + const CustomOneToOneGrid( + {super.key, this.isLocalInsetPresent = true, this.peerTracks}); @override State createState() => _CustomOneToOneGridState(); @@ -64,14 +66,6 @@ class _CustomOneToOneGridState extends State { Column( children: [ Expanded( - // child: TextureViewGrid( - // peerTracks: widget.isLocalInsetPresent - // ? data.item1 - // .where((element) => - // !(element.peer.isLocal) || - // element.track?.source == "SCREEN") - // .toList() - // : data.item1), child: PageView.builder( physics: const PageScrollPhysics(), controller: controller, diff --git a/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart b/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart index df926fd70..0c3f8b289 100644 --- a/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart +++ b/packages/hms_room_kit/lib/src/widgets/meeting_modes/one_to_one_mode.dart @@ -82,8 +82,9 @@ class _OneToOneModeState extends State { /// ///This is the case when the local peer is null or it doesn't have audio or videotrack (oneToOnePeer == null) - ? const CustomOneToOneGrid( + ? CustomOneToOneGrid( isLocalInsetPresent: false, + peerTracks: widget.peerTracks, ) ///This handles the case where local peer is the only peer in the room with audio or video track @@ -97,7 +98,9 @@ class _OneToOneModeState extends State { ///i.e. this handles the normal flow : Stack( children: [ - const CustomOneToOneGrid(), + CustomOneToOneGrid( + peerTracks: widget.peerTracks, + ), DraggableWidget( dragAnimationScale: 1, topMargin: 10, diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 019e12a8a..3a46aee60 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -43,9 +43,12 @@ android { } dependencies { - implementation "live.100ms:android-sdk:${sdkVersions['android']}" - implementation "live.100ms:video-view:${sdkVersions['android']}" - implementation "live.100ms:hls-player:${sdkVersions['android']}" +// implementation "live.100ms:android-sdk:${sdkVersions['android']}" +// implementation "live.100ms:video-view:${sdkVersions['android']}" +// implementation "live.100ms:hls-player:${sdkVersions['android']}" + implementation "com.github.100mslive.android-sdk:videoview:flutter-blframe-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:flutter-blframe-SNAPSHOT" + implementation 'com.github.100mslive.android-sdk:lib:flutter-blframe-SNAPSHOT' implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' From 79b2c38287c3e3ff80e72a8280c71f8b3077d5d0 Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:26:58 +0530 Subject: [PATCH 42/53] Added feature to disable name edit on preview (#1651) --- packages/hms_room_kit/lib/src/preview/preview_page.dart | 1 + packages/hms_room_kit/lib/src/screen_controller.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hms_room_kit/lib/src/preview/preview_page.dart b/packages/hms_room_kit/lib/src/preview/preview_page.dart index ceee4d80c..4f8945e5e 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_page.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_page.dart @@ -322,6 +322,7 @@ class _PreviewPageState extends State { height: 48, width: width * 0.50, child: TextField( + enabled: widget.name.trim().isEmpty, cursorColor: HMSThemeColors .onSurfaceHighEmphasis, diff --git a/packages/hms_room_kit/lib/src/screen_controller.dart b/packages/hms_room_kit/lib/src/screen_controller.dart index a7ab8d809..9b0090649 100644 --- a/packages/hms_room_kit/lib/src/screen_controller.dart +++ b/packages/hms_room_kit/lib/src/screen_controller.dart @@ -158,7 +158,7 @@ class _ScreenControllerState extends State { value: _previewStore, child: PreviewPage( roomCode: Constant.roomCode, - name: widget.options?.userName ?? "", + name: widget.options?.userName?.trim() ?? "", options: widget.options, )) : PreviewPermissions( From 36708d635a66ab1d60ce88a769dd403f9a78c3ca Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:39:12 +0530 Subject: [PATCH 43/53] Fixed empty message on role change decline (#1652) --- packages/hms_room_kit/example/pubspec.lock | 24 ++++++------------ .../lib/src/common/utility_functions.dart | 25 +++++++++---------- .../lib/src/meeting/meeting_store.dart | 4 ++- .../lib/src/preview/preview_page.dart | 4 ++- packages/hms_room_kit/pubspec.lock | 24 ++++++------------ packages/hms_room_kit/pubspec.yaml | 1 - 6 files changed, 34 insertions(+), 48 deletions(-) diff --git a/packages/hms_room_kit/example/pubspec.lock b/packages/hms_room_kit/example/pubspec.lock index 039975216..0d22984b5 100644 --- a/packages/hms_room_kit/example/pubspec.lock +++ b/packages/hms_room_kit/example/pubspec.lock @@ -41,14 +41,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - bot_toast: - dependency: transitive - description: - name: bot_toast - sha256: "6b93030a99a98335b8827ecd83021e92e885ffc61d261d3825ffdecdd17f3bdf" - url: "https://pub.dev" - source: hosted - version: "4.1.3" characters: dependency: transitive description: @@ -85,10 +77,10 @@ packages: dependency: transitive description: name: cross_file - sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.dev" source: hosted - version: "0.3.3+8" + version: "0.3.3+7" crypto: dependency: transitive description: @@ -234,10 +226,10 @@ packages: dependency: transitive description: name: http - sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.0" http_parser: dependency: transitive description: @@ -434,10 +426,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "5.4.0" platform: dependency: transitive description: @@ -759,10 +751,10 @@ packages: dependency: transitive description: name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "6.3.0" sdks: dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/lib/src/common/utility_functions.dart b/packages/hms_room_kit/lib/src/common/utility_functions.dart index 0981692f0..6049c2b87 100644 --- a/packages/hms_room_kit/lib/src/common/utility_functions.dart +++ b/packages/hms_room_kit/lib/src/common/utility_functions.dart @@ -1,13 +1,12 @@ -//Package imports +///Dart imports import 'dart:io'; import 'dart:math' as math; -import 'package:bot_toast/bot_toast.dart'; +///Package imports import 'package:flutter/material.dart'; import 'package:flutter_foreground_task/flutter_foreground_task.dart'; import 'package:hms_room_kit/hms_room_kit.dart'; import 'package:hmssdk_flutter/hmssdk_flutter.dart'; -import 'package:hms_room_kit/src/common/animated_text.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:shared_preferences/shared_preferences.dart'; @@ -266,16 +265,16 @@ class Utilities { static void showTimedMetadata(String message, {int time = 1, Alignment align = const Alignment(0, 0.8)}) { - BotToast.showText( - align: align, - wrapToastAnimation: (controller, cancelFunc, widget) => - AnimatedTextWidget( - text: message, duration: Duration(seconds: time)), - onlyOne: false, - textStyle: HMSTextStyle.setTextStyle(fontSize: 14), - text: message, - contentColor: Colors.black87, - duration: Duration(seconds: time)); + // BotToast.showText( + // align: align, + // wrapToastAnimation: (controller, cancelFunc, widget) => + // AnimatedTextWidget( + // text: message, duration: Duration(seconds: time)), + // onlyOne: false, + // textStyle: HMSTextStyle.setTextStyle(fontSize: 14), + // text: message, + // contentColor: Colors.black87, + // duration: Duration(seconds: time)); } static Future getStringData({required String key}) async { diff --git a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart index 15237b08b..0c5e6509c 100644 --- a/packages/hms_room_kit/lib/src/meeting/meeting_store.dart +++ b/packages/hms_room_kit/lib/src/meeting/meeting_store.dart @@ -1355,7 +1355,9 @@ class MeetingStore extends ChangeNotifier } void addMessage(HMSMessage message) { - messages.add(message); + if (message.type == "chat") { + messages.add(message); + } } void updatePeerAt(HMSPeer peer) { diff --git a/packages/hms_room_kit/lib/src/preview/preview_page.dart b/packages/hms_room_kit/lib/src/preview/preview_page.dart index 4f8945e5e..3215c8e03 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_page.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_page.dart @@ -322,7 +322,9 @@ class _PreviewPageState extends State { height: 48, width: width * 0.50, child: TextField( - enabled: widget.name.trim().isEmpty, + enabled: widget.name + .trim() + .isEmpty, cursorColor: HMSThemeColors .onSurfaceHighEmphasis, diff --git a/packages/hms_room_kit/pubspec.lock b/packages/hms_room_kit/pubspec.lock index c897422fb..6487a9a7c 100644 --- a/packages/hms_room_kit/pubspec.lock +++ b/packages/hms_room_kit/pubspec.lock @@ -41,14 +41,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - bot_toast: - dependency: "direct main" - description: - name: bot_toast - sha256: "6b93030a99a98335b8827ecd83021e92e885ffc61d261d3825ffdecdd17f3bdf" - url: "https://pub.dev" - source: hosted - version: "4.1.3" characters: dependency: transitive description: @@ -85,10 +77,10 @@ packages: dependency: transitive description: name: cross_file - sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.dev" source: hosted - version: "0.3.3+8" + version: "0.3.3+7" crypto: dependency: transitive description: @@ -219,10 +211,10 @@ packages: dependency: transitive description: name: http - sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.0" http_parser: dependency: transitive description: @@ -419,10 +411,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "5.4.0" platform: dependency: transitive description: @@ -744,10 +736,10 @@ packages: dependency: transitive description: name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "6.3.0" sdks: dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hms_room_kit/pubspec.yaml b/packages/hms_room_kit/pubspec.yaml index 63141d884..62f4bb34f 100644 --- a/packages/hms_room_kit/pubspec.yaml +++ b/packages/hms_room_kit/pubspec.yaml @@ -20,7 +20,6 @@ dependencies: permission_handler: ^11.0.0 provider: ^6.0.5 google_fonts: ^6.1.0 - bot_toast: ^4.0.4 draggable_widget: ^2.0.0 badges: ^3.1.1 shared_preferences: ^2.2.0 From b44cc36f22995c4bd21b557f06e53a03ae8caf93 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 5 Dec 2023 17:41:51 +0530 Subject: [PATCH 44/53] Updated changelog --- .../hmssdk_flutter/example/ExampleAppChangelog.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 603563cbb..183df101f 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -3,15 +3,16 @@ Board: https://100ms.atlassian.net/jira/software/projects/FLUT/boards/34/ - Added TextureView in place of SurfaceView for better performance https://100ms.atlassian.net/browse/FLUT-121 -- Video on preview is stretched. -https://100ms.atlassian.net/browse/FLUT-167 +- Disable editing username in preview screen if username is passed to prebuilt in options config +https://100ms.atlassian.net/browse/FLUT-158 -- when swiping page, there’s tile colored line between tiles. -https://100ms.atlassian.net/browse/FLUT-166 +- Getting 3 blank messages for flutter on stage user if declined 3 invite before +https://100ms.atlassian.net/browse/FLUT-172 -RC build +- Active Speaker should come within first 2 tiles when doing Screenshare +https://100ms.atlassian.net/browse/FLUT-161 Room Kit: 1.0.7 Core SDK: 1.9.4 Android SDK: 2.8.2 -iOS SDK: 1.3.0 +iOS SDK: 1.3.1 From 093d175547aa019c77f8de2bbdaee0a8b4f6b78b Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Tue, 5 Dec 2023 17:47:34 +0530 Subject: [PATCH 45/53] Updated android sdk branch to dev-v2 --- packages/hmssdk_flutter/android/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 3a46aee60..0a2c023f5 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -46,9 +46,9 @@ dependencies { // implementation "live.100ms:android-sdk:${sdkVersions['android']}" // implementation "live.100ms:video-view:${sdkVersions['android']}" // implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:flutter-blframe-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:flutter-blframe-SNAPSHOT" - implementation 'com.github.100mslive.android-sdk:lib:flutter-blframe-SNAPSHOT' + implementation "com.github.100mslive.android-sdk:videoview:dev-v2-SNAPSHOT" + implementation "com.github.100mslive.android-sdk:hls-player:dev-v2-SNAPSHOT" + implementation 'com.github.100mslive.android-sdk:lib:dev-v2-SNAPSHOT' implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' From 0450204b6d9aef3439619b2e1b8f3d264c7fc76d Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 6 Dec 2023 12:09:05 +0530 Subject: [PATCH 46/53] Updated android sdk version --- packages/hmssdk_flutter/android/build.gradle | 9 ++-- .../example/android/app/build.gradle | 4 +- .../example/ios/Runner/Info.plist | 4 +- packages/hmssdk_flutter/example/pubspec.lock | 50 ++++++++----------- .../lib/assets/sdk-versions.json | 2 +- packages/hmssdk_flutter/pubspec.lock | 26 +++++----- 6 files changed, 42 insertions(+), 53 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 0a2c023f5..019e12a8a 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -43,12 +43,9 @@ android { } dependencies { -// implementation "live.100ms:android-sdk:${sdkVersions['android']}" -// implementation "live.100ms:video-view:${sdkVersions['android']}" -// implementation "live.100ms:hls-player:${sdkVersions['android']}" - implementation "com.github.100mslive.android-sdk:videoview:dev-v2-SNAPSHOT" - implementation "com.github.100mslive.android-sdk:hls-player:dev-v2-SNAPSHOT" - implementation 'com.github.100mslive.android-sdk:lib:dev-v2-SNAPSHOT' + implementation "live.100ms:android-sdk:${sdkVersions['android']}" + implementation "live.100ms:video-view:${sdkVersions['android']}" + implementation "live.100ms:hls-player:${sdkVersions['android']}" implementation 'com.google.code.gson:gson:2.9.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0' diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 91546b5d0..8781891c8 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 398 - versionName "1.5.98" + versionCode 399 + versionName "1.5.99" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index ded573211..3ea685431 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.98 + 1.5.99 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 398 + 399 ITSAppUsesNonExemptEncryption LSApplicationCategoryType diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index f81a063e2..6333d5a32 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -49,14 +49,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.1" - bot_toast: - dependency: transitive - description: - name: bot_toast - sha256: "6b93030a99a98335b8827ecd83021e92e885ffc61d261d3825ffdecdd17f3bdf" - url: "https://pub.dev" - source: hosted - version: "4.1.3" characters: dependency: transitive description: @@ -77,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: @@ -93,10 +85,10 @@ packages: dependency: transitive description: name: cross_file - sha256: fedaadfa3a6996f75211d835aaeb8fede285dae94262485698afd832371b9a5e + sha256: "2f9d2cbccb76127ba28528cb3ae2c2326a122446a83de5a056aaa3880d3882c5" url: "https://pub.dev" source: hosted - version: "0.3.3+8" + version: "0.3.3+7" crypto: dependency: transitive description: @@ -306,10 +298,10 @@ packages: dependency: transitive description: name: http - sha256: d4872660c46d929f6b8a9ef4e7a7eff7e49bbf0c4ec3f385ee32df5119175139 + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "1.1.2" + version: "1.1.0" http_parser: dependency: transitive description: @@ -370,10 +362,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: @@ -514,10 +506,10 @@ packages: dependency: transitive description: name: petitparser - sha256: c15605cd28af66339f8eb6fbe0e541bfe2d1b72d5825efc6598f3e0a31b9ad27 + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "5.4.0" platform: dependency: transitive description: @@ -655,18 +647,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: @@ -687,10 +679,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: @@ -847,10 +839,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: @@ -871,10 +863,10 @@ packages: dependency: transitive description: name: xml - sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 + sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" + dart: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/lib/assets/sdk-versions.json b/packages/hmssdk_flutter/lib/assets/sdk-versions.json index 444bb2d86..56b239ded 100644 --- a/packages/hmssdk_flutter/lib/assets/sdk-versions.json +++ b/packages/hmssdk_flutter/lib/assets/sdk-versions.json @@ -3,5 +3,5 @@ "ios": "1.3.1", "iOSBroadcastExtension": "0.0.9", "iOSHLSPlayerSDK": "0.0.2", - "android": "2.8.2" + "android": "2.8.3" } diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index 53939cd59..c3cc2c33e 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,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" fake_async: dependency: transitive description: @@ -79,10 +79,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" path: dependency: transitive description: @@ -108,18 +108,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: @@ -140,10 +140,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" vector_math: dependency: transitive description: @@ -156,10 +156,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" sdks: - dart: ">=3.2.0-194.0.dev <4.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=2.10.0" From 2fed0b143471ba9810c626068e1feca13d52041b Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 6 Dec 2023 12:36:40 +0530 Subject: [PATCH 47/53] Fixed sizing issues --- .../lib/src/widgets/toasts/hms_bring_on_stage_toast.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart b/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart index 0b77cb457..55d54e0b1 100644 --- a/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart +++ b/packages/hms_room_kit/lib/src/widgets/toasts/hms_bring_on_stage_toast.dart @@ -83,7 +83,7 @@ class HMSBringOnStageToast extends StatelessWidget { } }, height: 36, - width: 135, + width: 128, buttonColor: HMSThemeColors.secondaryDefault, textColor: HMSThemeColors.onSecondaryHighEmphasis, ), From a1093d0467950dc190844cd02bace74683d8ebad Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 6 Dec 2023 12:54:44 +0530 Subject: [PATCH 48/53] =?UTF-8?q?released=20sample=20app=20version=201.5.1?= =?UTF-8?q?00=20(400)=20=F0=9F=8D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/ExampleAppChangelog.txt | 5 ++++- packages/hmssdk_flutter/example/android/app/build.gradle | 4 ++-- packages/hmssdk_flutter/example/ios/Runner/Info.plist | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt index 183df101f..6292c0c06 100644 --- a/packages/hmssdk_flutter/example/ExampleAppChangelog.txt +++ b/packages/hmssdk_flutter/example/ExampleAppChangelog.txt @@ -12,7 +12,10 @@ https://100ms.atlassian.net/browse/FLUT-172 - Active Speaker should come within first 2 tiles when doing Screenshare https://100ms.atlassian.net/browse/FLUT-161 +- Flutter iOS VNRT to stage, app crash. +https://100ms.atlassian.net/browse/FLUT-173 + Room Kit: 1.0.7 Core SDK: 1.9.4 -Android SDK: 2.8.2 +Android SDK: 2.8.3 iOS SDK: 1.3.1 diff --git a/packages/hmssdk_flutter/example/android/app/build.gradle b/packages/hmssdk_flutter/example/android/app/build.gradle index 8781891c8..65bf96f55 100644 --- a/packages/hmssdk_flutter/example/android/app/build.gradle +++ b/packages/hmssdk_flutter/example/android/app/build.gradle @@ -32,8 +32,8 @@ android { applicationId "live.hms.flutter" minSdkVersion 21 targetSdkVersion 33 - versionCode 399 - versionName "1.5.99" + versionCode 400 + versionName "1.5.100" } signingConfigs { diff --git a/packages/hmssdk_flutter/example/ios/Runner/Info.plist b/packages/hmssdk_flutter/example/ios/Runner/Info.plist index 3ea685431..1a590b7d7 100644 --- a/packages/hmssdk_flutter/example/ios/Runner/Info.plist +++ b/packages/hmssdk_flutter/example/ios/Runner/Info.plist @@ -21,7 +21,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.5.99 + 1.5.100 CFBundleSignature ???? CFBundleURLTypes @@ -48,7 +48,7 @@ CFBundleVersion - 399 + 400 ITSAppUsesNonExemptEncryption LSApplicationCategoryType From 3c56038d7f3b024adee1ecc8e086692dd7815726 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Wed, 6 Dec 2023 13:50:02 +0530 Subject: [PATCH 49/53] Removed logs --- .../main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt index 9d70dc219..82186a16e 100644 --- a/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt +++ b/packages/hmssdk_flutter/android/src/main/kotlin/live/hms/hmssdk_flutter/views/HMSTextureView.kt @@ -29,7 +29,6 @@ class HMSTextureView( private val videoViewStateChangeListener = object : VideoViewStateChangeListener{ override fun onResolutionChange(newWidth: kotlin.Int, newHeight: kotlin.Int) { - Log.i("Vkohli", "onResolutionChange -> newWidth:$newWidth, newHeight-> $newHeight") val args = HashMap() args["event_name"] = "on_resolution_changed" val data = HashMap() From 6dbea3d0262b61533b4012bcfa3287943c615afc Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 7 Dec 2023 02:17:08 +0530 Subject: [PATCH 50/53] Corrected comments --- .../hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart index 26145fae5..35e188382 100644 --- a/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart +++ b/packages/hmssdk_flutter/lib/src/ui/meeting/hms_texture_view.dart @@ -33,7 +33,7 @@ import 'package:hmssdk_flutter/hmssdk_flutter.dart'; /// **key** - [key] property can be used to forcefully rebuild the video widget by setting a unique key everytime. /// Similarly to avoid rebuilding the key should be kept the same for particular HMSVideoView. /// -/// **addTrackByDefault** - To call addTrack by default as HMSVideoView is attached to the tree. Default value is [true] +/// **addTrackByDefault** - To call addTrack by default as HMSTextureView is attached to the tree. Default value is [true] /// /// **controller** - To control the video view, this is useful for custom usecases when you wish to control the addTrack and removeTrack /// track functionalities on your own. From 97ee8fc2528688508ac12ba66aedcfa661cb1753 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 7 Dec 2023 02:19:13 +0530 Subject: [PATCH 51/53] removed unused code --- .../lib/src/widgets/common_widgets/peer_tile.dart | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart index e00d3e25e..f131045ac 100644 --- a/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart +++ b/packages/hms_room_kit/lib/src/widgets/common_widgets/peer_tile.dart @@ -64,12 +64,6 @@ class _PeerTileState extends State { if (mounted) { Provider.of(context, listen: false) .setOffScreenStatus(true); - if (context.read().track != null) { - // log("HMSVideoViewController remove video track ${context.read().peer.name}"); - - ///Avoiding remove track - // widget.videoViewController?.removeTrack(); - } } }, onFocusGained: () { From 195ad9c9902d6a50cf7f3be3aeff2fbdaea08fb7 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 7 Dec 2023 07:21:27 +0000 Subject: [PATCH 52/53] =?UTF-8?q?=F0=9F=A4=96=20Automated=20Format=20and?= =?UTF-8?q?=20Fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hmssdk_flutter/example/pubspec.lock | 26 ++++++++++---------- packages/hmssdk_flutter/pubspec.lock | 26 ++++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/packages/hmssdk_flutter/example/pubspec.lock b/packages/hmssdk_flutter/example/pubspec.lock index aaac23bd6..cff025339 100644 --- a/packages/hmssdk_flutter/example/pubspec.lock +++ b/packages/hmssdk_flutter/example/pubspec.lock @@ -69,10 +69,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" convert: dependency: transitive description: @@ -362,10 +362,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -647,18 +647,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -679,10 +679,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" tuple: dependency: transitive description: @@ -839,10 +839,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" win32: dependency: transitive description: @@ -868,5 +868,5 @@ packages: source: hosted version: "6.3.0" sdks: - dart: ">=3.2.0 <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=3.13.0" diff --git a/packages/hmssdk_flutter/pubspec.lock b/packages/hmssdk_flutter/pubspec.lock index c3cc2c33e..53939cd59 100644 --- a/packages/hmssdk_flutter/pubspec.lock +++ b/packages/hmssdk_flutter/pubspec.lock @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" fake_async: dependency: transitive description: @@ -79,10 +79,10 @@ packages: dependency: transitive description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" path: dependency: transitive description: @@ -108,18 +108,18 @@ packages: dependency: transitive description: name: stack_trace - sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.11.1" stream_channel: dependency: transitive description: name: stream_channel - sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" string_scanner: dependency: transitive description: @@ -140,10 +140,10 @@ packages: dependency: transitive description: name: test_api - sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" + sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.1" vector_math: dependency: transitive description: @@ -156,10 +156,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" sdks: - dart: ">=3.1.0-185.0.dev <4.0.0" + dart: ">=3.2.0-194.0.dev <4.0.0" flutter: ">=2.10.0" From 06ad194c973bb89f9ce93c9ee25225c34fafde11 Mon Sep 17 00:00:00 2001 From: Decoder07 Date: Thu, 7 Dec 2023 12:52:16 +0530 Subject: [PATCH 53/53] Fixed build.gradle --- packages/hmssdk_flutter/android/build.gradle | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/hmssdk_flutter/android/build.gradle b/packages/hmssdk_flutter/android/build.gradle index 019e12a8a..2ac0b37ec 100644 --- a/packages/hmssdk_flutter/android/build.gradle +++ b/packages/hmssdk_flutter/android/build.gradle @@ -10,7 +10,6 @@ buildscript { repositories { google() mavenCentral() - maven { url 'https://jitpack.io' } } dependencies { @@ -21,7 +20,6 @@ buildscript { rootProject.allprojects { repositories { -// mavenlocal() google() mavenCentral() maven { url 'https://jitpack.io' }