Skip to content

[BUG]: WebRTC.Initialize is removed and breaks the build of Example. #963

@winlinvip

Description

@winlinvip

Package version

3.0.0-pre.6

Environment

This PR #850 causes the build of the example to fail:

Assets/ossrs.io/Video Streaming and WebRTC Samples/Streamer/SrsStreamer.cs(34,16): 
error CS0117: 'WebRTC' does not contain a definition for 'Initialize'
private void Awake() 
{
    WebRTC.Initialize();
}

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:

// Something like this or similar to do this?
#if version < 3.0.0-pre.6
WebRTC.Initialize();
#endif

// Like OpenSSL version check?
#if OPENSSL_VERSION_NUMBER < 0x10002000L // v1.0.2
dtls_ctx = SSL_CTX_new(DTLSv1_method());
#else

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

  1. Use examples https://github.com/ossrs/srs-unity
  2. Install pre6.
  3. Build it, failed.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions