Skip to content

Conversation

@Yousif-CS
Copy link
Contributor

As the title says. Related ticket: https://opentelly.atlassian.net/browse/OPTI-658

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR exposes WebRTC configuration options for THEOlive Millicast sources on iOS. The change adds a new webrtc property to the TheoLiveSource interface that allows developers to configure playout delay settings when using THEOlive with WebRTC streaming.

  • Added webrtc property to TypeScript interface for THEOlive sources
  • Implemented iOS Swift code to parse and apply WebRTC playout delay configuration
  • Enables control over minimum and maximum playout delay values through the WebRTC options

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/api/theolive/TheoLiveSource.ts Adds optional webrtc property to TheoLiveSource TypeScript interface for WebRTC configuration
ios/theolive/THEOplayerRCTSourceDescriptionBuilder+Theolive.swift Implements iOS-specific parsing and building of WebRTC options with playout delay settings from JavaScript configuration

/**
* WebRTC configuration for a THEOlive Millicast source.
*/
webrtc?: Record<string, any>
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon at the end of the webrtc property declaration. All other properties in this interface (e.g., line 23) end with a semicolon, so this should too for consistency.

Suggested change
webrtc?: Record<string, any>
webrtc?: Record<string, any>;

Copilot uses AI. Check for mistakes.
/**
* WebRTC configuration for a THEOlive Millicast source.
*/
webrtc?: Record<string, any>
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type Record<string, any> is too permissive and loses type safety. Based on the iOS implementation which expects a playoutDelayMs object with minimum and maximum properties, consider defining a specific interface for the webrtc configuration. This would provide better type checking and IDE support for developers using this API. For example, you could define:

interface WebrtcPlayoutDelay {
  minimum: number;
  maximum: number;
}

interface TheoLiveWebrtcOptions {
  playoutDelayMs?: WebrtcPlayoutDelay;
}

Then use webrtc?: TheoLiveWebrtcOptions instead of Record<string, any>.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If indeed the record entries are known in advance and we are expecting specific values I'd rather have them explicitly typed.
Also perhaps rename webrtc to something that more suggests it contains a config? i.e. webrtcConfiguration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is named webrtc on other platforms, so I decided to be consistent. Though, I will change its type to a record instead

profile?: string;

/**
* WebRTC configuration for a THEOlive Millicast source.
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing platform annotation in the documentation. Since this webrtc configuration is only implemented for iOS (as indicated by the PR title and the fact that there's no corresponding Android implementation in SourceAdapter.kt), the documentation should include a @platform ios annotation to make it clear to developers which platforms support this feature.

Suggested change
* WebRTC configuration for a THEOlive Millicast source.
* WebRTC configuration for a THEOlive Millicast source.
* @platform ios

Copilot uses AI. Check for mistakes.
@Yousif-CS Yousif-CS changed the title Expose webrtc in TheoLiveSource on iOS Expose webrtc in TheoLiveSource on iOS/Android Dec 15, 2025
@Yousif-CS Yousif-CS requested a review from wjoosen December 15, 2025 08:00
@tvanlaerhoven tvanlaerhoven added the enhancement New feature or request label Dec 15, 2025
private static func buildWebrtcOptions(_ theoliveData: [String: Any]) -> WebrtcOptions? {
let webrtc = theoliveData[SD_PROP_WEBRTC] as? [String: Any]
let playoutDelay = webrtc?[SD_PROP_PLAYOUT_DELAY] as? [String: Int]
let playoutDelayMin = playoutDelay?[SD_PROP_PLAYOUT_DELAY_MIN]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's indeed make this explicit in the Typescript typing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright done. @RameshDPrasad could you confirm it still works on android?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it does.

@Yousif-CS
Copy link
Contributor Author

I've also exposed WebrtcOptions in the Endpoint, as it is public on iOS and Android.

@Yousif-CS
Copy link
Contributor Author

@wvanhaevre please have a look :)

@wvanhaevre
Copy link
Collaborator

@Yousif-CS, don't forget to add a changelog entry.


extension THEOplayerRCTSourceDescriptionBuilder {

private static func buildWebrtcOptions(_ theoliveData: [String: Any]) -> WebrtcOptions? {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WebrtcOptions is a THEOplayerSDK type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes it is

@Yousif-CS
Copy link
Contributor Author

@wvanhaevre should we wait to merge until 10.7 release is out? Otherwise develop will be broken (we need WebrtcOptions exposed in THEOplayer). How do we generally tackle this situation?

@wvanhaevre
Copy link
Collaborator

@wvanhaevre should we wait to merge until 10.7 release is out? Otherwise develop will be broken (we need WebrtcOptions exposed in THEOplayer). How do we generally tackle this situation?

Yes, we wait for the 10.7 to be released. Currently our CI testing fails because of the missing types. We can finish the PR and once the native SDK's are released we can make a react-native-theoplayer release.
You should update the react-native-theoplayer.podspec to indicate 10.7 as the minimal version for all packages.

@Yousif-CS Yousif-CS force-pushed the OPTI-658-millicast-config-react-native branch from f6ca5f3 to d0557a9 Compare December 18, 2025 22:36
@Yousif-CS Yousif-CS merged commit 172f3b0 into develop Dec 19, 2025
16 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants