Skip to content

Commit

Permalink
Merge pull request #869 from 100mslive/develop
Browse files Browse the repository at this point in the history
Release 0.7.7: Develop to main
  • Loading branch information
ygit authored Oct 20, 2022
2 parents e116826 + 339c6a8 commit 0d4c3b5
Show file tree
Hide file tree
Showing 56 changed files with 2,784 additions and 2,466 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.7.7 - 2022-10-20

- Added ability to set & get session metadata
- Added ability to join with muted audio & video using Initial states (Muted / Unmuted) `HMSVideoTrackSettings` & `HMSAudioTrackSettings` in the builder of HMSSDK
- Added better Telemetrics for analytics
- Added option to use Software Decoder for Video rendering on Android devices
- Added action result listener to `switchCamera` function on local video track
- Fixed LetterBoxing (Black borders on top and bottom) observed when sharing the screen in landscape mode on Android
- Fixed incorrect sending of Speaker Updates when peer has left the room
- Removed unused setters for Local Audio & Video Track Settings
- Updated to Native Android SDK 2.5.0 & Native iOS SDK 0.4.5

Full Changelog: [0.7.6...0.7.7](https://github.com/100mslive/100ms-flutter/compare/0.7.6...0.7.7)

## 0.7.6 - 2022-09-23

- Added audio output change listener callback while in Preview on Android
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
}

dependencies {
implementation 'com.github.100mslive.android-sdk:lib:2.4.8'
implementation 'com.github.100mslive.android-sdk:lib:2.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.5.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ class HMSAudioTrackSettingsExtension {
companion object{
fun toDictionary(hmsAudioTrackSettings: HMSAudioTrackSettings?):HashMap<String,Any>? {
val map = HashMap<String,Any>()
map["max_bit_rate"] = hmsAudioTrackSettings?.maxBitrate!!
// map["track_description"] = hmsAudioTrackSettings?.track_description ?: ""
map["volume"] = hmsAudioTrackSettings.volume
map["codec"]=AudioParamsExtension.getValueOfHMSAudioCodec(hmsAudioTrackSettings.codec)
map["user_hardware_acoustic_echo_canceler"] = hmsAudioTrackSettings.useHardwareAcousticEchoCanceler
return map
map["user_hardware_acoustic_echo_canceler"] = hmsAudioTrackSettings?.useHardwareAcousticEchoCanceler!!
map["track_initial_state"] = HMSTrackInitStateExtension.getValueFromHMSTrackInitState(hmsAudioTrackSettings.initialState)
return map
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class HMSRoomExtension {
HMSRoomUpdate.HLS_STREAMING_STATE_UPDATED-> "hls_streaming_state_updated"
HMSRoomUpdate.BROWSER_RECORDING_STATE_UPDATED-> "browser_recording_state_updated"
HMSRoomUpdate.HLS_RECORDING_STATE_UPDATED-> "hls_recording_state_updated"
HMSRoomUpdate.ROOM_NAME_UPDATED->"room_name_updated"
HMSRoomUpdate.ROOM_PEER_COUNT_UPDATED->"room_peer_count_updated"
else-> "defaultUpdate"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package live.hms.hmssdk_flutter

class HMSSessionMetadataExtension {
companion object{
fun toDictionary(metadata: String?):HashMap<String,Any?>?{

val hashMap=HashMap<String,Any?>()

hashMap["metadata"] = metadata

return hashMap
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ class HMSSpeakerExtension {
val hashMap = HashMap<String,Any?>()
if(speaker==null)return null
hashMap.put("audioLevel",speaker.level)
hashMap.put("track",HMSTrackExtension.toDictionary(speaker.hmsTrack))
hashMap.put("peer",HMSPeerExtension.toDictionary(speaker.peer))
val hmsTrackMap = HMSTrackExtension.toDictionary(speaker.hmsTrack)
val hmsPeerMap = HMSPeerExtension.toDictionary(speaker.peer)
if((hmsTrackMap == null) || (hmsPeerMap == null)){
return null
}
hashMap.put("track",hmsTrackMap)
hashMap.put("peer",hmsPeerMap)
return hashMap
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package live.hms.hmssdk_flutter

import live.hms.video.media.settings.HMSTrackSettings

class HMSTrackInitStateExtension {
companion object{
fun getHMSTrackInitStatefromValue(value:String):HMSTrackSettings.InitState{
return when(value){
"MUTED" -> HMSTrackSettings.InitState.MUTED
"UNMUTED" -> HMSTrackSettings.InitState.UNMUTED
else->HMSTrackSettings.InitState.MUTED
}
}

fun getValueFromHMSTrackInitState(hmsTrackInitState:HMSTrackSettings.InitState):String{
return when(hmsTrackInitState){
HMSTrackSettings.InitState.UNMUTED-> "UNMUTED"
HMSTrackSettings.InitState.MUTED-> "MUTED"
else->"MUTED"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,54 +32,53 @@ class HMSTrackSettingsExtension {

var hmsAudioTrackSettings = HMSAudioTrackSettings.Builder()
if (hmsAudioTrackHashMap != null) {
val maxBitRate = hmsAudioTrackHashMap["bit_rate"] as Int?
val volume = hmsAudioTrackHashMap["volume"] as Double?
val useHardwareAcousticEchoCanceler =
hmsAudioTrackHashMap["user_hardware_acoustic_echo_canceler"] as Boolean?
val audioCodec =
AudioParamsExtension.getValueOfHMSAudioCodecFromString(hmsAudioTrackHashMap["audio_codec"] as String?) as HMSAudioCodec?

if (maxBitRate != null) {
hmsAudioTrackSettings = hmsAudioTrackSettings.maxBitrate(maxBitRate)
}

if (volume != null) {
hmsAudioTrackSettings = hmsAudioTrackSettings.volume(volume)
}
val initialState = HMSTrackInitStateExtension.getHMSTrackInitStatefromValue(hmsAudioTrackHashMap["track_initial_state"] as String)

if (useHardwareAcousticEchoCanceler != null) {
hmsAudioTrackSettings = hmsAudioTrackSettings.setUseHardwareAcousticEchoCanceler(
useHardwareAcousticEchoCanceler
)
}

if (audioCodec != null) {
hmsAudioTrackSettings = hmsAudioTrackSettings.codec(audioCodec)
if(initialState != null){
hmsAudioTrackSettings = hmsAudioTrackSettings.initialState(initialState)
}
}


var hmsVideoTrackSettings = HMSVideoTrackSettings.Builder()
if (hmsVideoTrackHashMap != null) {
val maxBitRate = hmsVideoTrackHashMap["max_bit_rate"] as Int?
val maxFrameRate = hmsVideoTrackHashMap["max_frame_rate"] as Int?
val videoCodec =
VideoParamsExtension.getValueOfHMSAudioCodecFromString(hmsVideoTrackHashMap["video_codec"] as String?) as HMSVideoCodec?

val cameraFacing = getHMSCameraFacingFromValue(hmsVideoTrackHashMap["camera_facing"] as String?)
val disableAutoResize = hmsVideoTrackHashMap["disable_auto_resize"] as Boolean
val initialState = HMSTrackInitStateExtension.getHMSTrackInitStatefromValue(hmsVideoTrackHashMap["track_initial_state"] as String)
val forceSoftwareDecoder = hmsVideoTrackHashMap["force_software_decoder"] as Boolean

if (maxBitRate != null) {
hmsVideoTrackSettings = hmsVideoTrackSettings.maxBitrate(maxBitRate)
if(cameraFacing != null){
hmsVideoTrackSettings = hmsVideoTrackSettings.cameraFacing(cameraFacing)
}

if (maxFrameRate != null) {
hmsVideoTrackSettings = hmsVideoTrackSettings.maxFrameRate(maxFrameRate)
if(disableAutoResize != null){
hmsVideoTrackSettings = hmsVideoTrackSettings.disableAutoResize(disableAutoResize);
}
if (videoCodec != null) {
hmsVideoTrackSettings = hmsVideoTrackSettings.codec(videoCodec)
if(initialState != null){
hmsVideoTrackSettings = hmsVideoTrackSettings.initialState(initialState)
}
if(forceSoftwareDecoder != null){
hmsVideoTrackSettings = hmsVideoTrackSettings.forceSoftwareDecoder(forceSoftwareDecoder)
}
}

return HMSTrackSettings.Builder().audio(hmsAudioTrackSettings.build()).video(hmsVideoTrackSettings.build()).build()
}

private fun getHMSCameraFacingFromValue(cameraFacing:String?):HMSVideoTrackSettings.CameraFacing{
return when(cameraFacing){
"back" -> HMSVideoTrackSettings.CameraFacing.BACK
"front" -> HMSVideoTrackSettings.CameraFacing.FRONT
else -> HMSVideoTrackSettings.CameraFacing.FRONT
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ class HMSVideoTrackSettingsExtension {
fun toDictionary(hmsVideoTrackSettings: HMSVideoTrackSettings?):HashMap<String,Any>?{
val map = HashMap<String,Any>()
map["camera_facing"] = getValueOfHMSCameraFacing(hmsVideoTrackSettings?.cameraFacing)!!
map["video_codec"] = getValueOfHMSVideoCodec(hmsVideoTrackSettings?.codec)!!
map["max_bit_rate"] = hmsVideoTrackSettings?.maxBitRate!!
map["max_frame_rate"] = hmsVideoTrackSettings.maxFrameRate
map["disable_auto_resize"] = hmsVideoTrackSettings.disableAutoResize
map["disable_auto_resize"] = hmsVideoTrackSettings?.disableAutoResize!!
map["track_initial_state"] = HMSTrackInitStateExtension.getValueFromHMSTrackInitState(hmsVideoTrackSettings.initialState)
map["force_software_decoder"] = hmsVideoTrackSettings.forceSoftwareDecoder
return map
}

Expand All @@ -29,15 +28,5 @@ class HMSVideoTrackSettingsExtension {
}
}

private fun getValueOfHMSVideoCodec(codec: HMSVideoCodec?):String?{
if(codec==null)return null

return when(codec){
HMSVideoCodec.H264-> "h264"
HMSVideoCodec.VP8->"vp8"
HMSVideoCodec.VP9->"vp9"
else-> "defaultCodec"
}
}
}
}
Loading

0 comments on commit 0d4c3b5

Please sign in to comment.