-
Notifications
You must be signed in to change notification settings - Fork 199
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
[BUG]: WebRTC.Initialize is removed and breaks the build of Example. #963
Comments
@winlinvip The definition should be used in your script. Currently APIs are not stable yet, but I will try not to change APIs as possible. |
I changed the code to: private void Awake()
{
#if WEBRTC_3_0_0_PRE_6_OR_LATER
Debug.Log("WebRTC: WEBRTC_3_0_0_PRE_6_OR_LATER is enabled");
#else
WebRTC.Initialize();
#endif
Debug.Log("WebRTC: Initialize ok");
} Still failed:
I searched the macro |
@winlinvip |
Thank you, but I don't think that's the right approach. For instance, if I create a WEBRTC_3_0_0_PRE_6_OR_LATER, users would need to modify it based on the WebRTC SDK they're using. This could confuse people and make it difficult to use. Instead, I'd prefer to duplicate examples for each WebRTC SDK version, like:
Maintaining this would be a terrible experience for me. Please don't change the API. Why not keep the empty WebRTC.Initialize() and just remove it from the documentation? This way, it won't break the build. |
@winlinvip What I can't understand about your issue, I'm not sure why you need to add code for two versions. I think you can avoid duplication with define directives. Is there any reason? |
@karasusan I want to make one example that works for all webrtc sdk versions, like SrsPlayer.cs for pre4, pre5, and pre6. If the API isn't compatible, I'll need to create a separate repository or branch for each version, which will be confusing and complicated:
If the SDK API isn't compatible, it can cause problems for me and everyone else using the SDK. This can happen when we update it to fix issues or when a new user tries to use an API that doesn't match the examples. |
@winlinvip |
1. Define WEBRTC_3_0_0_PRE_5_OR_BEFORE in OSSRS.Samples.asmdef 2. Fix build fail for Unity-Technologies/com.unity.webrtc#963
Got it! Thank you! 👍 I add a file OSSRS.Samples.asmdef which defines: {
"references": [
"Unity.WebRTC"
],
"versionDefines": [
{
"name": "com.unity.webrtc",
"expression": "[2.4.0-exp.11,3.0.0-pre.5]",
"define": "WEBRTC_3_0_0_PRE_5_OR_BEFORE"
}
],
} In code such as SrsPublisher.cs to use the macro: private void Awake()
{
#if WEBRTC_3_0_0_PRE_5_OR_BEFORE
WebRTC.Initialize();
#endif
Debug.Log("WebRTC: Initialize ok");
} It works! BTW: I notice the pre7 is released at roadmap at 2023.9, but not in releases, how can I get the pre7 version and test it? Thank you. |
1. Define WEBRTC_3_0_0_PRE_5_OR_BEFORE in OSSRS.Samples.asmdef 2. Fix build fail for Unity-Technologies/com.unity.webrtc#963
@winlinvip |
Has version pre7 not been released yet? Are there any changes to the SDK? Will this SDK continue to be maintained in the future? 😅 |
Package version
3.0.0-pre.6
Environment
This PR #850 causes the build of the example to fail:
How can I write an example that is compatible with both pre5 and pre6? Pre5 requires
WebRTC.Initialize
, while pre6 has removed it. Is there any way to check the API version like OpenSSL:Alternatively, instead of removing the API, why not just retain it and make it empty function? This would be a straightforward approach to maintain API compatibility and prevent any disruptions.
If only support pre6, someone use old versions of SDK will file issues and get stuck.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: