Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

rebase Thaina/experimental/webgl platform to latest main #1076

Open
wants to merge 80 commits into
base: thaina/experimental/webgl-platform
Choose a base branch
from

Conversation

Thaina
Copy link

@Thaina Thaina commented Jan 12, 2025

No description provided.

miyabi and others added 30 commits December 7, 2024 08:41
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
…24-media-stream-track

doc: Improve documentation of MediaStreamTrack
…24-audio-stream-track

doc: Improve documentation of AudioStreamTrack
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
…24-web-rtc

doc: Improve documentation of WebRTC
…24-rtc-rtp-transceiver

doc: Improve documentation of RTCRtpTransceiver
…24-rtc-rtp-sender

doc: Improve documentation of RTCRtpSender
…24-rtc-rtp-encoding-parameters

doc: Improve documentation of RTCRtpEncodingParameters
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
Co-authored-by: chrstphrsxtn <74899224+chrstphrsxtn@users.noreply.github.com>
…24-video-stream-track

doc: Improve documentation of VideoStreamTrack
…24-rtc-configuration

doc: Improve documentation of RTCConfiguration
…24-rtc-data-channel

Dw24 rtc data channel
* add documentation
* add class summary
* simplify code
* update example
* update package.json
* update changelog
* update readme
* update ValidationExceptions.json
* update install.md
* update bug_report.yml
* webgl initial plugin

* merge with @gtk2k prototype (part 1)

* Add newtonsoft json parser in package dependencies

* merge with @gtk2k prototype (part 2)

* webgl lib compile fixes

* WebGL build can be done

* bugfix : remove useless condition that brake linux compatibility

* Initial WebGL webrtc plugins

* Merge branch 'feature/webgl-support' of https://github.com/antoined73/com.unity.webrtc into antoined73-feature/webgl-support

* Added OnTextMessage on RTCDataChannel
Renamed VideoStreamTrack

* Remove duplicate method RegisterRenderingWebRTCPlugin in WebTC.cs

* Merge branch 'feature/webgl-support' of https://github.com/antoined73/com.unity.webrtc into antoined73-feature/webgl-support

* Signaling is not part of WebRTC specification

* Browser crash on DataChannel options using newtonsoft

* Added missing ContextUnRegisterMediaStreamObserver, not implemented yet

* Removed audio/video offer options

* Added missing ReceiverGetStreams, not implemented yet

* RTCIceCandidates on WebGL

* Moved RTCDataChannel onmessage listeren to OnDataChannel (receiver) from createDataChannel (sender)

* Added VideoTrack with MediaStream created by WebGL's getUserMedia. Requires the RTCPeerConnection to have a MediaStream to attach to.

* Fixed CreateAudioTrack

* Fixed adding getUserMedia stream tracks to unity MediaStream

* Enabled open/close/message on both creation and ondatachannel objects

* Negotiation workaround
Often the candidate message is handled earlier than the description (probably due coroutines when setting the description)
For now the icecandidate handling waits 1 second, which is sufficient. But a fix would be to store an ICECandidate queue on the peer connection and handle the queue when the description is set

* Workaround to parse datachannel options, jsonutility/newtonsoft have trouble with the Optional fields

* Samples: working DataChannels and PeerConnection
- Fixed MediaStream getTracks with deserializer
- Added adapter.js, should improve browser compatibility
- Using objects instead of 'this' in jslib for peer events

* Added TextMessage event handling for DataChannels sample

* Fix for UpdateRendererTexture 'no video' issue

* Temp to show video tracks created by peer.ontrack

* getTracks using WebRTC.Deserialize, prevents creation of existing tracks

* Using Deserializer for RTP objects

* Firefox requires a string, instead of int for credentialType

* Fixed optional fields serialization in RTCConfiguration

* Disabled context check. Context is already removed when disposing peer/data/media objects

* Improved UWManaged array. C# objects can be disposed but still accessed at a later stage

* Delete transceiver

* Fixed DeleteMediaStreamTrack parameters

* Registering stream for videotrack is not needed

* Removing video tracks from local/remote video list object on DeleteMediaStreamTrack

* Added RegisterMediaStreamObserver, not tested

* DataChannel options parsing done in jslib file

* Moved parsing of RTCConfiguration

* Updated webrtc.dll

* Wip: create audiotrack

* Corrected RTCConfiguration parsing with new optional fields using enums

* Fixed webcam stream from getUserMedia
Improved creation of HTMLMediaElements, local and remote tracks are created on AddTrack and ontrack respectively, which enables the receiver to play the received audio stream.
The local video track is currently only needed to display the local webcam stream, but is created for every videotrack (todo)

* Added a check for RTCDataChannels onclose/open. onclose is fired when already disposed in unity.

* Fixed icecandidate struct

* Missing import and removed peer label (for now)

* Fixed some enum values (including ice/peer connection state)

* RTCStats. Not fully checked for every enum/statstype. Note: Requires "jillejr.newtonsoft.json-for-unity"

* Don't show video elements

* Use strToPtr

* RTPParameters

* RTPParameters

* RTPParameters: removed debug log and added todo

* setCodec support, only supported in chrome

* Datachannel config parsing to support firefox

* Removed debug log

* Removed debug logs

* Removed dual initializers (sourcetree bug?)

* Moved OnRemoveTrack

* Added guard for sender track

* Moved #!UNITY_WEBGL inside WebRTC.Sync

* Reducing the number of #if !UNITY_WEBL directives

* Using RTCOfferOptions object

* Added todo's

* Removed commented lines

* Removed comments lines in RTCStats

* Removed/optimized some #if webgl directives

* Added WebGLSample

* Default flip, so the correct image is transported over webrtc

* Updated local render method with flip

* Updated samples to allow webgl builds

* Some comments/codestyle changes

* Added getUserMedia TODO

* Reverted Android meta change

* fix test-case

* revert asmdef

* fixed compile error

* fix compile error

(cherry picked from commit 8eb9e4b)

* add webgl platform to CI test

(cherry picked from commit a478886)

* fix yaml

(cherry picked from commit 00939df785d1b5da64d7e3ab0795600e4f17d1a1)

* fix yaml

* fix

* fix bug

* fix yaml

* fix permission

* add job to test for webgl platform

* WIP test runner and jslib fixes
- Runs [Test] methods
- Parameterized tests are disabled [TestCase]
- Added webgl platform exclude to [UnityTest]
- VideoReceiver disabled
- AudioStream disabled
- (todo) NativeAPI
- Fixed several native method bugs

* wip NativeAPI test
enabled most test cases
needs json dll

* Passing DataChannelTest

* Fixed several tests
- Transceiver direction
- Ice candidate component (added todo/comments)
- MediaStreamAddTrack return value
- ContextCreate methods with labels
- Dummy TrackSource methods
- AudioTrack id (added custom guid field)
- MediaStream id (added custom guid field)
- Fixed NativeAPITest for WebGL MediaStream tracks length

* More test fixes - Replaced return with array  [errortype,object]
- AddTrack retursn both sender and errortype
- SetDescription returns errortype and message. TODO: make async/await to actually return the error(type)

* Fixed test cases
- Applied OptionalFields for PeerConnection config
- Fixed IceTransportPolicy enum
- Fixed Set Description of PeerConnection
- Enabled VideoReceiveTest (but are commented out)
- Added TODOs

* fix yaml for package test

* Add Preserve attribute for avoiding code stripping

* Fixed Transceiver SetCodecsPreferences

* Fixed incorrect assert in SenderGetParameter test

* Excluded failing tests + added todos

* Fixed SetLocalDescriptionWithoutDescription

* Added WebGL sample to build settings

* add edtitor version for auto-testing on CI

* Replaced Pointer_Stringify with UTF8ToString to support 2021.2

* fix: undefined `side` variable

* fix: undefined `err` variable

* fix: pass byt length to `DataChannelNativeOnMessage` callback

* ops...

Co-authored-by: Antoine Dezarnaud <dezartoine@hotmail.fr>
Co-authored-by: Antoine Dezarnaud <antoine.dezarnaud-ext@epicnpoc.com>
Co-authored-by: kazuki <karasusan@gmail.com>
Co-authored-by: Muka Schultze <samuelschultze@gmail.com>
Co-authored-by: gtk2k <gtk2k@yahoo.co.jp>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants