Skip to content

Commit ea14ac1

Browse files
authored
Merge pull request #852 from THEOplayer/devin/1782121628-bridge-v3-discovery-properties
feat: bridge V3 discovery response properties to React Native
2 parents c3a7498 + 64fd716 commit ea14ac1

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

android/src/main/java/com/theoplayer/theolive/EndpointAdapter.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ private const val PROP_MILLICAST_SUBSCRIBER_TOKEN ="subscriberToken"
1515
private const val PROP_MILLICAST_DIRECTOR_URL = "directorUrl"
1616
private const val PROP_HESP_SRC = "hespSrc"
1717
private const val PROP_HLS_SRC = "hlsSrc"
18+
private const val PROP_HLS_MPEG_TS_SRC = "hlsMpegTsSrc"
1819
private const val PROP_AD_SRC = "adSrc"
20+
private const val PROP_DAI_ASSET_KEY = "daiAssetKey"
1921
private const val PROP_CDN = "cdn"
2022
private const val PROP_TARGET_LATENCY = "targetLatency"
2123
private const val PROP_WEIGHT = "weight"
@@ -44,7 +46,9 @@ object EndpointAdapter {
4446
endPoint.millicastSrc?.let { putMap(PROP_MILLICAST_SRC, fromEndPointMillicastSource(it)) }
4547
endPoint.hespSrc?.let { putString(PROP_HESP_SRC, it) }
4648
endPoint.hlsSrc?.let { putString(PROP_HLS_SRC, it) }
49+
endPoint.hlsMpegTsSrc?.let { putString(PROP_HLS_MPEG_TS_SRC, it) }
4750
endPoint.adSrc?.let { putString(PROP_AD_SRC, it) }
51+
endPoint.daiAssetKey?.let { putString(PROP_DAI_ASSET_KEY, it) }
4852
endPoint.cdn?.let { putString(PROP_CDN, it) }
4953
endPoint.targetLatency?.let { putDouble(PROP_TARGET_LATENCY, it) }
5054
putInt(PROP_WEIGHT, endPoint.weight)

ios/theolive/THEOplayerRCTTHEOliveEventAdapter.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import THEOplayerTHEOliveIntegration
99

1010
let PROP_ENDPOINT_HESP_SRC: String = "hespSrc"
1111
let PROP_ENDPOINT_HLS_SRC: String = "hlsSrc"
12+
let PROP_ENDPOINT_HLS_MPEG_TS_SRC: String = "hlsMpegTsSrc"
1213
let PROP_ENDPOINT_MILLICAST_SRC: String = "millicastSrc"
1314
let PROP_ENDPOINT_CDN: String = "cdn"
1415
let PROP_ENDPOINT_AD_SRC: String = "adSrc"
16+
let PROP_ENDPOINT_DAI_ASSET_KEY: String = "daiAssetKey"
1517
let PROP_ENDPOINT_WEIGHT: String = "weight"
1618
let PROP_ENDPOINT_PRIORITY: String = "priority"
1719
let PROP_ENDPOINT_CONTENT_PROTECTION: String = "contentProtection"
@@ -46,6 +48,9 @@ class THEOplayerRCTTHEOliveEventAdapter {
4648
if let hlsSrc = endpoint.hlsSrc {
4749
endpointData[PROP_ENDPOINT_HLS_SRC] = hlsSrc
4850
}
51+
if let hlsMpegTsSrc = endpoint.hlsMpegTsSrc {
52+
endpointData[PROP_ENDPOINT_HLS_MPEG_TS_SRC] = hlsMpegTsSrc
53+
}
4954
if let millicastSrc = endpoint.millicastSrc {
5055
endpointData[PROP_ENDPOINT_MILLICAST_SRC] = millicastSrc.toJSONEncodableDictionary()
5156
}
@@ -55,6 +60,9 @@ class THEOplayerRCTTHEOliveEventAdapter {
5560
if let adSrc = endpoint.adSrc {
5661
endpointData[PROP_ENDPOINT_AD_SRC] = adSrc
5762
}
63+
if let daiAssetKey = endpoint.daiAssetKey {
64+
endpointData[PROP_ENDPOINT_DAI_ASSET_KEY] = daiAssetKey
65+
}
5866
if let contentProtection = endpoint.channelContentProtection {
5967
endpointData[PROP_ENDPOINT_CONTENT_PROTECTION] = THEOplayerRCTTHEOliveEventAdapter.fromContentProtection(contentProtection: contentProtection)
6068
}

src/api/theolive/TheoLiveEndpoint.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { TheoLiveDistribution } from './TheoLiveDistribution';
12
import { WebrtcOptions } from './WebrtcOptions';
23

34
export interface EndpointMillicastSource {
@@ -16,14 +17,57 @@ export interface EndpointMillicastSource {
1617
* @public
1718
*/
1819
export interface TheoLiveEndpoint {
20+
/**
21+
* The source of this endpoint.
22+
*
23+
* @remarks
24+
* For most endpoint types, this is the source URL string.
25+
* For millicast endpoints, this is a {@link EndpointMillicastSource} object.
26+
*
27+
* @platform web
28+
*/
29+
src?: string | EndpointMillicastSource;
30+
31+
/**
32+
* The type of source (e.g. 'hesp', 'hls', 'hlsMpegTs', 'millicast', 'dai').
33+
*
34+
* @platform web
35+
*/
36+
srcType?: string;
37+
38+
/**
39+
* The provider of this endpoint (e.g. 'optiview').
40+
*
41+
* @platform web
42+
*/
43+
provider?: string;
44+
1945
millicastSrc?: EndpointMillicastSource;
2046
hespSrc?: string;
2147
hlsSrc?: string;
48+
hlsMpegTsSrc?: string;
2249
adSrc?: string;
50+
daiAssetKey?: string;
51+
2352
cdn?: string;
53+
54+
/**
55+
* The target latency for this endpoint, in seconds.
56+
*
57+
* @platform android
58+
*/
59+
targetLatency?: number;
60+
2461
weight: number;
2562
priority: number;
2663
contentProtection?: ChannelDrmConfigResponse;
64+
65+
/**
66+
* The distribution associated with this endpoint.
67+
*
68+
* @platform web
69+
*/
70+
distribution?: TheoLiveDistribution;
2771
}
2872

2973
/**

0 commit comments

Comments
 (0)