Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [10.7.0] - 25-12-19

### Added

- Added a webrtc configuration property `webrtc` in `TheoLiveSource`, to enable configuring the playout delay for Millicast streams consumed through OptiView Live.

## [10.6.1] - 25-12-18

### Fixed
Expand Down
21 changes: 20 additions & 1 deletion android/src/main/java/com/theoplayer/source/SourceAdapter.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import com.theoplayer.android.api.cmcd.CMCDTransmissionMode
import com.theoplayer.android.api.error.ErrorCode
import com.theoplayer.android.api.source.AdIntegration
import com.theoplayer.android.api.source.dash.DashPlaybackConfiguration
import com.theoplayer.android.api.theolive.PlayoutDelay
import com.theoplayer.android.api.theolive.TheoLiveSource
import com.theoplayer.android.api.theolive.WebRTCOptions
import com.theoplayer.cmcd.CmcdTransmissionMode
import com.theoplayer.drm.ContentProtectionAdapter
import com.theoplayer.latency.parseLatencyConfiguration
Expand Down Expand Up @@ -72,6 +74,10 @@ private const val PROP_SSE_ENDPOINT = "sseEndpoint"
private const val PROP_STREAM_ACTIVITY_MONITOR_ID = "streamActivityMonitorId"
private const val PROP_LATENCY_CONFIGURATION = "latencyConfiguration"
private const val PROP_PROFILE = "profile"
private const val PROP_WEBRTC: String = "webrtc"
private const val PROP_PLAYOUT_DELAY: String = "playoutDelayMs"
private const val PROP_PLAYOUT_DELAY_MIN: String = "minimum"
private const val PROP_PLAYOUT_DELAY_MAX: String = "maximum"

private const val ERROR_IMA_NOT_ENABLED = "Google IMA support not enabled."
private const val ERROR_THEOADS_NOT_ENABLED = "THEOads support not enabled."
Expand Down Expand Up @@ -183,10 +189,23 @@ class SourceAdapter {
drm=jsonTypedSource.optJSONObject(PROP_CONTENT_PROTECTION)?.let {
ContentProtectionAdapter.drmConfigurationFromJson(it)
},
profile=jsonTypedSource.optString(PROP_PROFILE)
profile=jsonTypedSource.optString(PROP_PROFILE),
webrtc=parseWebRTCOptions(jsonTypedSource)
)
}

@Throws(THEOplayerException::class)
private fun parseWebRTCOptions(jsonWebrtcOptions: JSONObject): WebRTCOptions? {
val webrtc = jsonWebrtcOptions.optJSONObject(PROP_WEBRTC)
val playoutDelay = webrtc?.optJSONObject(PROP_PLAYOUT_DELAY)
val playoutDelayMin = playoutDelay?.optInt(PROP_PLAYOUT_DELAY_MIN)
val playoutDelayMax = playoutDelay?.optInt(PROP_PLAYOUT_DELAY_MAX)

if (playoutDelayMin == null || playoutDelayMax == null) return null

return WebRTCOptions(playoutDelayMs = PlayoutDelay(playoutDelayMin, playoutDelayMax))
}

@Throws(THEOplayerException::class)
private fun parseTypedSource(jsonTypedSource: JSONObject, cmcdTransmissionMode: CMCDTransmissionMode? = null): TypedSource {
// Property `integration` will be replaced with `type`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,22 @@ import THEOplayerTHEOliveIntegration
#endif

let SD_PROP_PROFILE: String = "profile"
let SD_PROP_WEBRTC: String = "webrtc"
let SD_PROP_PLAYOUT_DELAY: String = "playoutDelayMs"
let SD_PROP_PLAYOUT_DELAY_MIN: String = "minimum"
let SD_PROP_PLAYOUT_DELAY_MAX: String = "maximum"

extension THEOplayerRCTSourceDescriptionBuilder {

private static func buildWebrtcOptions(_ theoliveData: [String: Any]) -> WebrtcOptions? {
let webrtc = theoliveData[SD_PROP_WEBRTC] as? NSDictionary
let playoutDelay = webrtc?[SD_PROP_PLAYOUT_DELAY] as? NSDictionary
let playoutDelayMin = playoutDelay?[SD_PROP_PLAYOUT_DELAY_MIN] as? Int
let playoutDelayMax = playoutDelay?[SD_PROP_PLAYOUT_DELAY_MAX] as? Int
guard let playoutDelayMin, let playoutDelayMax else { return nil }
return WebrtcOptions(playoutDelayMs: PlayoutDelay(minimum: playoutDelayMin, maximum: playoutDelayMax))
}

/**
Builds a THEOplayer SourceDescription that can be passed as a source for the THEOplayer.
- returns: a THEOlive TypedSource.
Expand All @@ -20,7 +33,8 @@ extension THEOplayerRCTSourceDescriptionBuilder {
#if canImport(THEOplayerTHEOliveIntegration)
if let src = theoliveData[SD_PROP_SRC] as? String {
let profile = theoliveData[SD_PROP_PROFILE] as? String;
return TheoLiveSource(channelId: src, drm: contentProtection, profile: profile)
let webrtc = buildWebrtcOptions(theoliveData)
return TheoLiveSource(channelId: src, drm: contentProtection, profile: profile, webrtc: webrtc)
}
#endif
return nil
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-theoplayer",
"version": "10.6.1",
"version": "10.7.0",
"description": "A THEOplayer video component for react-native.",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down
14 changes: 7 additions & 7 deletions react-native-theoplayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,37 @@ Pod::Spec.new do |s|

# THEOplayer Dependency
puts "Adding THEOplayerSDK-core"
s.dependency "THEOplayerSDK-core", "~> 10.6"
s.dependency "THEOplayerSDK-core", "~> 10.7"

# THEOlive Dependency
puts "Adding THEOplayer-Integration-THEOlive"
s.dependency "THEOplayer-Integration-THEOlive", "~> 10.6"
s.dependency "THEOplayer-Integration-THEOlive", "~> 10.7"

# Feature based integration dependencies
if theofeatures.include?("GOOGLE_IMA")
puts "Adding THEOplayer-Integration-GoogleIMA"
s.dependency "THEOplayer-Integration-GoogleIMA", "~> 10.6"
s.dependency "THEOplayer-Integration-GoogleIMA", "~> 10.7"
end

if theofeatures.include?("CHROMECAST")
puts "Adding THEOplayer-Integration-GoogleCast"
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 10.6"
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 10.7"
end

if theofeatures.include?("THEO_ADS")
puts "Adding THEOplayer-Integration-THEOads"
s.dependency "THEOplayer-Integration-THEOads", "~> 10.6"
s.dependency "THEOplayer-Integration-THEOads", "~> 10.7"
end

if theofeatures.include?("MILLICAST")
puts "Adding THEOplayer-Integration-Millicast"
s.dependency "THEOplayer-Integration-Millicast", "~> 10.6"
s.dependency "THEOplayer-Integration-Millicast", "~> 10.7"
end

# Feature based connector dependencies
if theofeatures.include?("SIDELOADED_TEXTTRACKS")
puts "Adding THEOplayer-Connector-SideloadedSubtitle"
s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 10.6"
s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 10.7"
end

end
3 changes: 3 additions & 0 deletions src/api/theolive/TheoLiveEndpoint.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { WebrtcOptions } from "./WebrtcOptions";

export interface EndpointMillicastSource {
name: string;
accountId: string;
subscriberToken?: string;
directorUrl?: string;
webrtc?: WebrtcOptions
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/api/theolive/TheoLiveSource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { SourceIntegrationId, TypedSource } from 'react-native-theoplayer';
import { WebrtcOptions } from './WebrtcOptions';

/**
* Represents a source for the THEOlive integration.
Expand All @@ -21,4 +22,9 @@ export interface TheoLiveSource extends TypedSource {
* The profile identifier is included as a query parameter in the discovery request to obtain a response specific to that profile.
*/
profile?: string;

/**
* WebRTC configuration for a THEOlive Millicast source.
*/
webrtc?: WebrtcOptions;
}
28 changes: 28 additions & 0 deletions src/api/theolive/WebrtcOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

/**
* Webrtc playout delay configuration.
*
* This is used to configure the playout delay for a Millicast Source. This hints Webrtc
* to increase the jitter buffer size.
*
* @category THEOlive
* @remark This is a hint, and factors like network jitter and audio/video sync latency affect the actual delay applied.
* @public
*/
export interface WebrtcPlayoutDelay {
minimum: number;
maximum: number;
}

/**
* WebRTC configuration for a THEOlive Millicast source.
*
* @category THEOlive
* @public
*/
export interface WebrtcOptions {
/**
* Webrtc playout delay configuration for the Webrtc media.
*/
playoutDelayMs?: WebrtcPlayoutDelay;
}
Loading