Skip to content

Commit

Permalink
Implement MediaStreamTrack.height() and MediaStreamTrack.width()
Browse files Browse the repository at this point in the history
…methods (#129)

Co-authored-by: alexlapa <[email protected]>
Co-authored-by: Kai Ren <[email protected]>
  • Loading branch information
3 people authored Dec 4, 2023
1 parent e0b1e41 commit 0fe64b4
Show file tree
Hide file tree
Showing 26 changed files with 762 additions and 146 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ All user visible changes to this project will be documented in this file. This p
### Added

- `RtpTransceiverInit.sendEncodings` field with `SendEncodingParameters`. ([#125])
- `MediaStreamTrack.height()` and `MediaStreamTrack.width()` methods. ([#129])
- `RtpParameters` class, `RtpSender.getParameters()` and `RtpSender.setParameters()` methods. ([#135])

### Changed
Expand All @@ -34,6 +35,7 @@ All user visible changes to this project will be documented in this file. This p
[#123]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/123
[#124]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/124
[#125]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/125
[#129]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/129
[#133]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/133
[#135]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/135
[#136]: https://github.com/instrumentisto/medea-flutter-webrtc/pull/136
Expand Down
115 changes: 62 additions & 53 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ 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 kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

/**
* Controller of [MediaStreamTrackProxy] functional.
Expand Down Expand Up @@ -55,6 +58,12 @@ class MediaStreamTrackController(
"state" -> {
result.success(track.state.value)
}
"width" -> {
GlobalScope.launch(Dispatchers.Main) { result.success(track.width()) }
}
"height" -> {
GlobalScope.launch(Dispatchers.Main) { result.success(track.height()) }
}
"stop" -> {
track.stop()
result.success(null)
Expand Down
Loading

0 comments on commit 0fe64b4

Please sign in to comment.