react-native-theoplayer 2.15.0 → 2.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.1.0/)
6
6
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.16.1] - 23-09-27
9
+
10
+ ### Added
11
+
12
+ - For iOS, added a subtitlePTS property to the TextTrackDescription that syncs a sideloaded textTrack with the video content.
13
+
8
14
  ## [2.15.0] - 23-09-26
9
15
 
10
16
  ### Changed
package/README.md CHANGED
@@ -72,6 +72,7 @@ functionality. Currently, the following connectors are available:
72
72
  | [`@theoplayer/react-native-analytics-agama`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Agama analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-agama)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-agama) |
73
73
  | [`@theoplayer/react-native-analytics-comscore`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Comscore analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-comscore)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-comscore) |
74
74
  | [`@theoplayer/react-native-analytics-conviva`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Conviva analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-conviva)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-conviva) |
75
+ | [`@theoplayer/react-native-analytics-mux`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Mux analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-mux)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-mux) |
75
76
  | [`@theoplayer/react-native-analytics-nielsen`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Nielsen analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-nielsen)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-nielsen) |
76
77
  | [`@theoplayer/react-native-analytics-youbora`](https://github.com/THEOplayer/react-native-theoplayer-analytics) | Youbora analytics connector | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-analytics-youbora)](https://www.npmjs.com/package/@theoplayer/react-native-analytics-youbora) |
77
78
  | [`@theoplayer/react-native-drm`](https://github.com/THEOplayer/react-native-theoplayer-drm) | Content protection (DRM) connectors | [![npm](https://img.shields.io/npm/v/@theoplayer/react-native-drm)](https://www.npmjs.com/package/@theoplayer/react-native-drm) |
@@ -4,6 +4,10 @@ import Foundation
4
4
  import THEOplayerSDK
5
5
  import UIKit
6
6
 
7
+ #if canImport(THEOplayerConnectorSideloadedSubtitle)
8
+ import THEOplayerConnectorSideloadedSubtitle
9
+ #endif
10
+
7
11
  let SD_PROP_SOURCES: String = "sources"
8
12
  let SD_PROP_POSTER: String = "poster"
9
13
  let SD_PROP_TEXTTRACKS: String = "textTracks"
@@ -42,6 +46,8 @@ let SD_PROP_METADATA_RELEASE_DATE: String = "releaseDate"
42
46
  let SD_PROP_METADATA_RELEASE_YEAR: String = "releaseYear"
43
47
  let SD_PROP_METADATA_TITLE: String = "title"
44
48
  let SD_PROP_METADATA_SUBTITLE: String = "subtitle"
49
+ let SD_PROP_PTS: String = "subtitlePTS"
50
+ let SD_PROP_LOCALTIME: String = "subtitleLocaltime"
45
51
 
46
52
  let EXTENSION_HLS: String = ".m3u8"
47
53
  let EXTENSION_MP4: String = ".mp4"
@@ -185,12 +191,28 @@ class THEOplayerRCTSourceDescriptionBuilder {
185
191
  let textTrackLabel = textTracksData[SD_PROP_LABEL] as? String
186
192
  let textTrackKind = THEOplayerRCTSourceDescriptionBuilder.extractTextTrackKind(textTracksData[SD_PROP_KIND] as? String)
187
193
  let textTrackFormat = THEOplayerRCTSourceDescriptionBuilder.extractTextTrackFormat(textTracksData[SD_PROP_FORMAT] as? String)
188
- return TextTrackDescription(src: textTrackSrc,
189
- srclang: textTrackSrcLang,
190
- isDefault: textTrackIsDefault,
191
- kind: textTrackKind,
192
- label: textTrackLabel,
193
- format: textTrackFormat)
194
+ let textTrackPTS = textTracksData[SD_PROP_PTS] as? String
195
+ let textTrackLocalTime = textTracksData[SD_PROP_LOCALTIME] as? String ?? "00:00:00.000"
196
+
197
+ #if canImport(THEOplayerConnectorSideloadedSubtitle)
198
+ let ttDescription = SSTextTrackDescription(src: textTrackSrc,
199
+ srclang: textTrackSrcLang,
200
+ isDefault: textTrackIsDefault,
201
+ kind: textTrackKind,
202
+ label: textTrackLabel,
203
+ format: textTrackFormat)
204
+ if let pts = textTrackPTS {
205
+ ttDescription.vttTimestamp = .init(pts: pts, localTime: textTrackLocalTime)
206
+ }
207
+ #else
208
+ let ttDescription = TextTrackDescription(src: textTrackSrc,
209
+ srclang: textTrackSrcLang,
210
+ isDefault: textTrackIsDefault,
211
+ kind: textTrackKind,
212
+ label: textTrackLabel,
213
+ format: textTrackFormat)
214
+ #endif
215
+ return ttDescription
194
216
  }
195
217
  return nil
196
218
  }
@@ -263,7 +285,7 @@ class THEOplayerRCTSourceDescriptionBuilder {
263
285
  }
264
286
  #endif
265
287
 
266
- /**
288
+ /**
267
289
  Updates the contentProtectionData to a valid iOS SDK contentProtectionData, flattening out cross SDK differences
268
290
  - returns: a THEOplayer valid contentProtection data map
269
291
  */
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["SourceDescription.ts"],"sourcesContent":["/**\n * Represents a media resource.\n *\n * @remarks\n * <br/> - Can be a string value representing the URL of a media resource, a {@link TypedSource}.\n *\n * @public\n */\nimport type { DashPlaybackConfiguration } from './dash/DashPlaybackConfiguration';\nimport type { DRMConfiguration } from './drm/DRMConfiguration';\nimport type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';\nimport type { AdDescription } from './ads/Ads';\nimport type { MetadataDescription } from './metadata/MetadataDescription';\nimport type { ServerSideAdInsertionConfiguration } from \"./ads/ssai/ServerSideAdInsertionConfiguration\";\nimport type { AnalyticsDescription } from \"./analytics/AnalyticsDescription\";\n\nexport type Source = TypedSource;\n\n/**\n * A media resource or list of media resources.\n *\n * @remarks\n * <br/> - The order of sources when using a list determines their priority when attempting playback.\n *\n * @public\n */\nexport type Sources = Source | Source[];\n\n/**\n * The cross-origin setting of a source, represented by a value from the following list:\n * <br/> - `'anonymous'`: CORS requests will have the credentials flag set to 'same-origin'.\n * <br/> - `'use-credentials'`: CORS requests will have the credentials flag set to 'include'.\n * <br/> - `''`: Setting the empty string is the same as `'anonymous'`\n *\n * @remarks\n * <br/> - See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes | The crossorigin attribute: Requesting CORS access to content}\n *\n * @public\n */\nexport type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceConfiguration {\n /**\n * List of {@link AdDescription}s to be queued for playback.\n */\n ads?: AdDescription[];\n\n /**\n * Content protection configuration.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The poster of the media source.\n *\n * @remarks\n * <br/> - An empty string (`''`) clears the current poster.\n * <br/> - This poster has priority over {@link ChromelessPlayer.poster}.\n */\n poster?: string;\n\n /**\n * List of text tracks to be side-loaded with the media source.\n *\n * @remarks\n * <br/> - A source change will reset side-loaded text tracks.\n */\n textTracks?: TextTrackDescription[];\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - All sources will use the time server. Alternatively, for one source use {@link BaseSource.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Describes the metadata of a source.\n *\n * @public\n */\n metadata?: MetadataDescription;\n\n /**\n * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.\n */\n analytics?: AnalyticsDescription[];\n}\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceDescription extends SourceConfiguration {\n /**\n * One or more media resources for playback.\n *\n * @remarks\n * <br/> - Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.\n * <br/> - The player will try each source in the provided order.\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://www.widevine.com/ | Widevine} or {@link https://www.microsoft.com/playready/ | PlayReady} CDM, for example on Safari.\n * In that case, the player will try to play the HLS source instead.\n *\n * ```\n * [{\n * src: 'dash-source-with-drm.mpd'\n * contentProtection: {\n * widevine: {\n * licenseAcquisitionURL: 'https://license.company.com/wv'\n * },\n * playready: {\n * licenseAcquisitionURL: 'https://license.company.com/pr'\n * }\n * }\n * },{\n * src: 'hls-source-with-drm.m3u8',\n * contentProtection: {\n * fairplay: {\n * certificateURL: 'https://license.company.com/fp'\n * }\n * }\n * }]\n * ```\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API | Media Source Extensions API}.\n * In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.\n *\n * ```\n * [{\n * src: 'source.mpd'\n * },{\n * src: 'source.mp4'\n * }]\n * ```\n */\n sources?: Sources;\n}\n\n/**\n * Describes the configuration of a side-loaded text track.\n *\n * @public\n */\nexport interface TextTrackDescription {\n /**\n * Whether the text track should be enabled by default.\n *\n * @remarks\n * <br/> - Only one text track per {@link TextTrack.kind} may be marked as default.\n *\n * @defaultValue `false`\n */\n default?: boolean;\n\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track provides subtitles, used to display subtitles in a video.\n * <br/> - `'captions'`: The track provides a translation of dialogue and sound effects (suitable for users with a hearing impairment).\n * <br/> - `'descriptions'`: The track provides a textual description of the video (suitable for users with a vision impairment).\n * <br/> - `'chapters'`: The track provides chapter titles (suitable for navigating the media resource).\n * <br/> - `'metadata'`: The track provides content used by scripts and is not visible for users.\n *\n * @remarks\n * <br/> - If an unrecognized value is provided, the player will interpret it as `'metadata'`.\n *\n * @defaultValue `'subtitles'`\n */\n kind?: string;\n\n /**\n * The format of the track, represented by a value from the following list:\n * <br/> - `'srt'`\n * <br/> - `'ttml'`\n * <br/> - `'webvtt'`\n * <br/> - `'emsg'`\n * <br/> - `'eventstream'`\n * <br/> - `'id3'`\n * <br/> - `'cea608'`\n * <br/> - `'daterange'`\n *\n * @defaultValue `''`\n */\n format?: string;\n\n /**\n * The source URL of the text track.\n */\n src: string;\n\n /**\n * The language of the text track.\n */\n srclang?: string;\n\n /**\n * A label for the text track.\n *\n * @remarks\n * <br/> - This will be used as an identifier on the player API and in the UI.\n */\n label?: string;\n\n /**\n * The identifier of this text track.\n *\n * @internal\n */\n // Note: This works for HLS, but not for DASH.\n id?: string;\n}\n\n/**\n * Represents the common properties of a media resource.\n *\n * @public\n */\nexport interface BaseSource {\n\n /**\n * The cross-origin setting of the source.\n *\n * @defaultValue `''`\n */\n crossOrigin?: CrossOriginSetting;\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - Available since v2.47.0.\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - Only this source will use the time server. Alternatively, for all source use {@link SourceConfiguration.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Whether the source should be played in the low-latency-mode of the player.\n *\n * @defaultValue `false`\n *\n * @remarks\n * <br/> - This setting must be `true` when using Low-Latency CMAF with ABR.\n * <br/> - Available since v2.62.0.\n */\n lowLatency?: boolean;\n\n /**\n * The configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.79.0.\n * <br/> - Ignored for non-DASH streams.\n */\n dash?: DashPlaybackConfiguration;\n\n /**\n * The configuration for controlling playback of an HLS stream.\n *\n * @remarks\n * <br/> - Available since v2.82.0.\n * <br/> - Ignored for non-HLS streams.\n */\n hls?: HlsPlaybackConfiguration;\n}\n\n/**\n * Represents a media resource characterized by a URL to the resource and optionally information about the resource.\n *\n * @public\n */\nexport interface TypedSource extends BaseSource {\n /**\n * The source URL of the media resource.\n *\n * @remarks\n * <br/> - Required if the `ssai` property is absent.\n * <br/> - Available since v2.4.0.\n */\n src?: string;\n\n /**\n * The content type (MIME type) of the media resource, represented by a value from the following list:\n * <br/> - `'application/dash+xml'`: The media resource is an MPEG-DASH stream.\n * <br/> - `'application/x-mpegURL'` or `'application/vnd.apple.mpegurl'`: The media resource is an HLS stream.\n * <br/> - `'video/mp4'`, `'video/webm'` and other formats: The media resource should use native HTML5 playback if supported by the browser.\n * <br/> - `'application/vnd.theo.hesp+json'`: The media resource is an HESP stream.\n *\n * @remarks\n * <br/> - Available since v2.4.0.\n */\n type?: string;\n\n /**\n * The content protection parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.15.0.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The Server-side Ad Insertion parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.12.0.\n */\n ssai?: ServerSideAdInsertionConfiguration;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["SourceDescription.ts"],"sourcesContent":["/**\n * Represents a media resource.\n *\n * @remarks\n * <br/> - Can be a string value representing the URL of a media resource, a {@link TypedSource}.\n *\n * @public\n */\nimport type { DashPlaybackConfiguration } from './dash/DashPlaybackConfiguration';\nimport type { DRMConfiguration } from './drm/DRMConfiguration';\nimport type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';\nimport type { AdDescription } from './ads/Ads';\nimport type { MetadataDescription } from './metadata/MetadataDescription';\nimport type { ServerSideAdInsertionConfiguration } from \"./ads/ssai/ServerSideAdInsertionConfiguration\";\nimport type { AnalyticsDescription } from \"./analytics/AnalyticsDescription\";\n\nexport type Source = TypedSource;\n\n/**\n * A media resource or list of media resources.\n *\n * @remarks\n * <br/> - The order of sources when using a list determines their priority when attempting playback.\n *\n * @public\n */\nexport type Sources = Source | Source[];\n\n/**\n * The cross-origin setting of a source, represented by a value from the following list:\n * <br/> - `'anonymous'`: CORS requests will have the credentials flag set to 'same-origin'.\n * <br/> - `'use-credentials'`: CORS requests will have the credentials flag set to 'include'.\n * <br/> - `''`: Setting the empty string is the same as `'anonymous'`\n *\n * @remarks\n * <br/> - See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes | The crossorigin attribute: Requesting CORS access to content}\n *\n * @public\n */\nexport type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceConfiguration {\n /**\n * List of {@link AdDescription}s to be queued for playback.\n */\n ads?: AdDescription[];\n\n /**\n * Content protection configuration.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The poster of the media source.\n *\n * @remarks\n * <br/> - An empty string (`''`) clears the current poster.\n * <br/> - This poster has priority over {@link ChromelessPlayer.poster}.\n */\n poster?: string;\n\n /**\n * List of text tracks to be side-loaded with the media source.\n *\n * @remarks\n * <br/> - A source change will reset side-loaded text tracks.\n */\n textTracks?: TextTrackDescription[];\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - All sources will use the time server. Alternatively, for one source use {@link BaseSource.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Describes the metadata of a source.\n *\n * @public\n */\n metadata?: MetadataDescription;\n\n /**\n * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.\n */\n analytics?: AnalyticsDescription[];\n}\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceDescription extends SourceConfiguration {\n /**\n * One or more media resources for playback.\n *\n * @remarks\n * <br/> - Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.\n * <br/> - The player will try each source in the provided order.\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://www.widevine.com/ | Widevine} or {@link https://www.microsoft.com/playready/ | PlayReady} CDM, for example on Safari.\n * In that case, the player will try to play the HLS source instead.\n *\n * ```\n * [{\n * src: 'dash-source-with-drm.mpd'\n * contentProtection: {\n * widevine: {\n * licenseAcquisitionURL: 'https://license.company.com/wv'\n * },\n * playready: {\n * licenseAcquisitionURL: 'https://license.company.com/pr'\n * }\n * }\n * },{\n * src: 'hls-source-with-drm.m3u8',\n * contentProtection: {\n * fairplay: {\n * certificateURL: 'https://license.company.com/fp'\n * }\n * }\n * }]\n * ```\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API | Media Source Extensions API}.\n * In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.\n *\n * ```\n * [{\n * src: 'source.mpd'\n * },{\n * src: 'source.mp4'\n * }]\n * ```\n */\n sources?: Sources;\n}\n\n/**\n * Describes the configuration of a side-loaded text track.\n *\n * @public\n */\nexport interface TextTrackDescription {\n /**\n * Whether the text track should be enabled by default.\n *\n * @remarks\n * <br/> - Only one text track per {@link TextTrack.kind} may be marked as default.\n *\n * @defaultValue `false`\n */\n default?: boolean;\n\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track provides subtitles, used to display subtitles in a video.\n * <br/> - `'captions'`: The track provides a translation of dialogue and sound effects (suitable for users with a hearing impairment).\n * <br/> - `'descriptions'`: The track provides a textual description of the video (suitable for users with a vision impairment).\n * <br/> - `'chapters'`: The track provides chapter titles (suitable for navigating the media resource).\n * <br/> - `'metadata'`: The track provides content used by scripts and is not visible for users.\n *\n * @remarks\n * <br/> - If an unrecognized value is provided, the player will interpret it as `'metadata'`.\n *\n * @defaultValue `'subtitles'`\n */\n kind?: string;\n\n /**\n * The format of the track, represented by a value from the following list:\n * <br/> - `'srt'`\n * <br/> - `'ttml'`\n * <br/> - `'webvtt'`\n * <br/> - `'emsg'`\n * <br/> - `'eventstream'`\n * <br/> - `'id3'`\n * <br/> - `'cea608'`\n * <br/> - `'daterange'`\n *\n * @defaultValue `''`\n */\n format?: string;\n\n /**\n * The source URL of the text track.\n */\n src: string;\n\n /**\n * The language of the text track.\n */\n srclang?: string;\n\n /**\n * A label for the text track.\n *\n * @remarks\n * <br/> - This will be used as an identifier on the player API and in the UI.\n */\n label?: string;\n\n /**\n * The identifier of this text track.\n *\n * @internal\n */\n // Note: This works for HLS, but not for DASH.\n id?: string;\n\n /**\n * The PTS value used to sync the track with the video.\n *\n * @internal\n * \n * @remarks\n * <br/> - Available on iOS.\n */\n subtitlePTS?: string;\n\n /**\n * The localTime that matches the PTS value that is used to sync the track with the video.\n *\n * @internal\n * @remarks\n * <br/> - Available on iOS. \n * <br/> - Format: \"HH:mm:mm:SSS\" \n * <br/> - Default value is \"00:00:00:000\"\n */\n subtitleLocaltime?: string;\n}\n\n/**\n * Represents the common properties of a media resource.\n *\n * @public\n */\nexport interface BaseSource {\n\n /**\n * The cross-origin setting of the source.\n *\n * @defaultValue `''`\n */\n crossOrigin?: CrossOriginSetting;\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - Available since v2.47.0.\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - Only this source will use the time server. Alternatively, for all source use {@link SourceConfiguration.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Whether the source should be played in the low-latency-mode of the player.\n *\n * @defaultValue `false`\n *\n * @remarks\n * <br/> - This setting must be `true` when using Low-Latency CMAF with ABR.\n * <br/> - Available since v2.62.0.\n */\n lowLatency?: boolean;\n\n /**\n * The configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.79.0.\n * <br/> - Ignored for non-DASH streams.\n */\n dash?: DashPlaybackConfiguration;\n\n /**\n * The configuration for controlling playback of an HLS stream.\n *\n * @remarks\n * <br/> - Available since v2.82.0.\n * <br/> - Ignored for non-HLS streams.\n */\n hls?: HlsPlaybackConfiguration;\n}\n\n/**\n * Represents a media resource characterized by a URL to the resource and optionally information about the resource.\n *\n * @public\n */\nexport interface TypedSource extends BaseSource {\n /**\n * The source URL of the media resource.\n *\n * @remarks\n * <br/> - Required if the `ssai` property is absent.\n * <br/> - Available since v2.4.0.\n */\n src?: string;\n\n /**\n * The content type (MIME type) of the media resource, represented by a value from the following list:\n * <br/> - `'application/dash+xml'`: The media resource is an MPEG-DASH stream.\n * <br/> - `'application/x-mpegURL'` or `'application/vnd.apple.mpegurl'`: The media resource is an HLS stream.\n * <br/> - `'video/mp4'`, `'video/webm'` and other formats: The media resource should use native HTML5 playback if supported by the browser.\n * <br/> - `'application/vnd.theo.hesp+json'`: The media resource is an HESP stream.\n *\n * @remarks\n * <br/> - Available since v2.4.0.\n */\n type?: string;\n\n /**\n * The content protection parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.15.0.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The Server-side Ad Insertion parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.12.0.\n */\n ssai?: ServerSideAdInsertionConfiguration;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["SourceDescription.ts"],"sourcesContent":["/**\n * Represents a media resource.\n *\n * @remarks\n * <br/> - Can be a string value representing the URL of a media resource, a {@link TypedSource}.\n *\n * @public\n */\nimport type { DashPlaybackConfiguration } from './dash/DashPlaybackConfiguration';\nimport type { DRMConfiguration } from './drm/DRMConfiguration';\nimport type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';\nimport type { AdDescription } from './ads/Ads';\nimport type { MetadataDescription } from './metadata/MetadataDescription';\nimport type { ServerSideAdInsertionConfiguration } from \"./ads/ssai/ServerSideAdInsertionConfiguration\";\nimport type { AnalyticsDescription } from \"./analytics/AnalyticsDescription\";\n\nexport type Source = TypedSource;\n\n/**\n * A media resource or list of media resources.\n *\n * @remarks\n * <br/> - The order of sources when using a list determines their priority when attempting playback.\n *\n * @public\n */\nexport type Sources = Source | Source[];\n\n/**\n * The cross-origin setting of a source, represented by a value from the following list:\n * <br/> - `'anonymous'`: CORS requests will have the credentials flag set to 'same-origin'.\n * <br/> - `'use-credentials'`: CORS requests will have the credentials flag set to 'include'.\n * <br/> - `''`: Setting the empty string is the same as `'anonymous'`\n *\n * @remarks\n * <br/> - See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes | The crossorigin attribute: Requesting CORS access to content}\n *\n * @public\n */\nexport type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceConfiguration {\n /**\n * List of {@link AdDescription}s to be queued for playback.\n */\n ads?: AdDescription[];\n\n /**\n * Content protection configuration.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The poster of the media source.\n *\n * @remarks\n * <br/> - An empty string (`''`) clears the current poster.\n * <br/> - This poster has priority over {@link ChromelessPlayer.poster}.\n */\n poster?: string;\n\n /**\n * List of text tracks to be side-loaded with the media source.\n *\n * @remarks\n * <br/> - A source change will reset side-loaded text tracks.\n */\n textTracks?: TextTrackDescription[];\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - All sources will use the time server. Alternatively, for one source use {@link BaseSource.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Describes the metadata of a source.\n *\n * @public\n */\n metadata?: MetadataDescription;\n\n /**\n * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.\n */\n analytics?: AnalyticsDescription[];\n}\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceDescription extends SourceConfiguration {\n /**\n * One or more media resources for playback.\n *\n * @remarks\n * <br/> - Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.\n * <br/> - The player will try each source in the provided order.\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://www.widevine.com/ | Widevine} or {@link https://www.microsoft.com/playready/ | PlayReady} CDM, for example on Safari.\n * In that case, the player will try to play the HLS source instead.\n *\n * ```\n * [{\n * src: 'dash-source-with-drm.mpd'\n * contentProtection: {\n * widevine: {\n * licenseAcquisitionURL: 'https://license.company.com/wv'\n * },\n * playready: {\n * licenseAcquisitionURL: 'https://license.company.com/pr'\n * }\n * }\n * },{\n * src: 'hls-source-with-drm.m3u8',\n * contentProtection: {\n * fairplay: {\n * certificateURL: 'https://license.company.com/fp'\n * }\n * }\n * }]\n * ```\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API | Media Source Extensions API}.\n * In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.\n *\n * ```\n * [{\n * src: 'source.mpd'\n * },{\n * src: 'source.mp4'\n * }]\n * ```\n */\n sources?: Sources;\n}\n\n/**\n * Describes the configuration of a side-loaded text track.\n *\n * @public\n */\nexport interface TextTrackDescription {\n /**\n * Whether the text track should be enabled by default.\n *\n * @remarks\n * <br/> - Only one text track per {@link TextTrack.kind} may be marked as default.\n *\n * @defaultValue `false`\n */\n default?: boolean;\n\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track provides subtitles, used to display subtitles in a video.\n * <br/> - `'captions'`: The track provides a translation of dialogue and sound effects (suitable for users with a hearing impairment).\n * <br/> - `'descriptions'`: The track provides a textual description of the video (suitable for users with a vision impairment).\n * <br/> - `'chapters'`: The track provides chapter titles (suitable for navigating the media resource).\n * <br/> - `'metadata'`: The track provides content used by scripts and is not visible for users.\n *\n * @remarks\n * <br/> - If an unrecognized value is provided, the player will interpret it as `'metadata'`.\n *\n * @defaultValue `'subtitles'`\n */\n kind?: string;\n\n /**\n * The format of the track, represented by a value from the following list:\n * <br/> - `'srt'`\n * <br/> - `'ttml'`\n * <br/> - `'webvtt'`\n * <br/> - `'emsg'`\n * <br/> - `'eventstream'`\n * <br/> - `'id3'`\n * <br/> - `'cea608'`\n * <br/> - `'daterange'`\n *\n * @defaultValue `''`\n */\n format?: string;\n\n /**\n * The source URL of the text track.\n */\n src: string;\n\n /**\n * The language of the text track.\n */\n srclang?: string;\n\n /**\n * A label for the text track.\n *\n * @remarks\n * <br/> - This will be used as an identifier on the player API and in the UI.\n */\n label?: string;\n\n /**\n * The identifier of this text track.\n *\n * @internal\n */\n // Note: This works for HLS, but not for DASH.\n id?: string;\n}\n\n/**\n * Represents the common properties of a media resource.\n *\n * @public\n */\nexport interface BaseSource {\n\n /**\n * The cross-origin setting of the source.\n *\n * @defaultValue `''`\n */\n crossOrigin?: CrossOriginSetting;\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - Available since v2.47.0.\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - Only this source will use the time server. Alternatively, for all source use {@link SourceConfiguration.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Whether the source should be played in the low-latency-mode of the player.\n *\n * @defaultValue `false`\n *\n * @remarks\n * <br/> - This setting must be `true` when using Low-Latency CMAF with ABR.\n * <br/> - Available since v2.62.0.\n */\n lowLatency?: boolean;\n\n /**\n * The configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.79.0.\n * <br/> - Ignored for non-DASH streams.\n */\n dash?: DashPlaybackConfiguration;\n\n /**\n * The configuration for controlling playback of an HLS stream.\n *\n * @remarks\n * <br/> - Available since v2.82.0.\n * <br/> - Ignored for non-HLS streams.\n */\n hls?: HlsPlaybackConfiguration;\n}\n\n/**\n * Represents a media resource characterized by a URL to the resource and optionally information about the resource.\n *\n * @public\n */\nexport interface TypedSource extends BaseSource {\n /**\n * The source URL of the media resource.\n *\n * @remarks\n * <br/> - Required if the `ssai` property is absent.\n * <br/> - Available since v2.4.0.\n */\n src?: string;\n\n /**\n * The content type (MIME type) of the media resource, represented by a value from the following list:\n * <br/> - `'application/dash+xml'`: The media resource is an MPEG-DASH stream.\n * <br/> - `'application/x-mpegURL'` or `'application/vnd.apple.mpegurl'`: The media resource is an HLS stream.\n * <br/> - `'video/mp4'`, `'video/webm'` and other formats: The media resource should use native HTML5 playback if supported by the browser.\n * <br/> - `'application/vnd.theo.hesp+json'`: The media resource is an HESP stream.\n *\n * @remarks\n * <br/> - Available since v2.4.0.\n */\n type?: string;\n\n /**\n * The content protection parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.15.0.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The Server-side Ad Insertion parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.12.0.\n */\n ssai?: ServerSideAdInsertionConfiguration;\n}\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["SourceDescription.ts"],"sourcesContent":["/**\n * Represents a media resource.\n *\n * @remarks\n * <br/> - Can be a string value representing the URL of a media resource, a {@link TypedSource}.\n *\n * @public\n */\nimport type { DashPlaybackConfiguration } from './dash/DashPlaybackConfiguration';\nimport type { DRMConfiguration } from './drm/DRMConfiguration';\nimport type { HlsPlaybackConfiguration } from './hls/HlsPlaybackConfiguration';\nimport type { AdDescription } from './ads/Ads';\nimport type { MetadataDescription } from './metadata/MetadataDescription';\nimport type { ServerSideAdInsertionConfiguration } from \"./ads/ssai/ServerSideAdInsertionConfiguration\";\nimport type { AnalyticsDescription } from \"./analytics/AnalyticsDescription\";\n\nexport type Source = TypedSource;\n\n/**\n * A media resource or list of media resources.\n *\n * @remarks\n * <br/> - The order of sources when using a list determines their priority when attempting playback.\n *\n * @public\n */\nexport type Sources = Source | Source[];\n\n/**\n * The cross-origin setting of a source, represented by a value from the following list:\n * <br/> - `'anonymous'`: CORS requests will have the credentials flag set to 'same-origin'.\n * <br/> - `'use-credentials'`: CORS requests will have the credentials flag set to 'include'.\n * <br/> - `''`: Setting the empty string is the same as `'anonymous'`\n *\n * @remarks\n * <br/> - See {@link https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes | The crossorigin attribute: Requesting CORS access to content}\n *\n * @public\n */\nexport type CrossOriginSetting = '' | 'anonymous' | 'use-credentials';\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceConfiguration {\n /**\n * List of {@link AdDescription}s to be queued for playback.\n */\n ads?: AdDescription[];\n\n /**\n * Content protection configuration.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The poster of the media source.\n *\n * @remarks\n * <br/> - An empty string (`''`) clears the current poster.\n * <br/> - This poster has priority over {@link ChromelessPlayer.poster}.\n */\n poster?: string;\n\n /**\n * List of text tracks to be side-loaded with the media source.\n *\n * @remarks\n * <br/> - A source change will reset side-loaded text tracks.\n */\n textTracks?: TextTrackDescription[];\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - All sources will use the time server. Alternatively, for one source use {@link BaseSource.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Describes the metadata of a source.\n *\n * @public\n */\n metadata?: MetadataDescription;\n\n /**\n * List of {@link AnalyticsDescription}s to configure source-related properties for analytics connectors.\n */\n analytics?: AnalyticsDescription[];\n}\n\n/**\n * Describes the configuration of a player's source.\n *\n * @public\n */\nexport interface SourceDescription extends SourceConfiguration {\n /**\n * One or more media resources for playback.\n *\n * @remarks\n * <br/> - Multiple media sources should be used to increase platform compatibility. See examples below for important use cases.\n * <br/> - The player will try each source in the provided order.\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://www.widevine.com/ | Widevine} or {@link https://www.microsoft.com/playready/ | PlayReady} CDM, for example on Safari.\n * In that case, the player will try to play the HLS source instead.\n *\n * ```\n * [{\n * src: 'dash-source-with-drm.mpd'\n * contentProtection: {\n * widevine: {\n * licenseAcquisitionURL: 'https://license.company.com/wv'\n * },\n * playready: {\n * licenseAcquisitionURL: 'https://license.company.com/pr'\n * }\n * }\n * },{\n * src: 'hls-source-with-drm.m3u8',\n * contentProtection: {\n * fairplay: {\n * certificateURL: 'https://license.company.com/fp'\n * }\n * }\n * }]\n * ```\n *\n * @example\n * In this example, the player will first try to play the DASH source.\n * This might fail if the browser does not support the {@link https://developer.mozilla.org/en-US/docs/Web/API/Media_Source_Extensions_API | Media Source Extensions API}.\n * In that case, the player will try to play the MP4 source instead, though without features such as adaptive bitrate switching.\n *\n * ```\n * [{\n * src: 'source.mpd'\n * },{\n * src: 'source.mp4'\n * }]\n * ```\n */\n sources?: Sources;\n}\n\n/**\n * Describes the configuration of a side-loaded text track.\n *\n * @public\n */\nexport interface TextTrackDescription {\n /**\n * Whether the text track should be enabled by default.\n *\n * @remarks\n * <br/> - Only one text track per {@link TextTrack.kind} may be marked as default.\n *\n * @defaultValue `false`\n */\n default?: boolean;\n\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track provides subtitles, used to display subtitles in a video.\n * <br/> - `'captions'`: The track provides a translation of dialogue and sound effects (suitable for users with a hearing impairment).\n * <br/> - `'descriptions'`: The track provides a textual description of the video (suitable for users with a vision impairment).\n * <br/> - `'chapters'`: The track provides chapter titles (suitable for navigating the media resource).\n * <br/> - `'metadata'`: The track provides content used by scripts and is not visible for users.\n *\n * @remarks\n * <br/> - If an unrecognized value is provided, the player will interpret it as `'metadata'`.\n *\n * @defaultValue `'subtitles'`\n */\n kind?: string;\n\n /**\n * The format of the track, represented by a value from the following list:\n * <br/> - `'srt'`\n * <br/> - `'ttml'`\n * <br/> - `'webvtt'`\n * <br/> - `'emsg'`\n * <br/> - `'eventstream'`\n * <br/> - `'id3'`\n * <br/> - `'cea608'`\n * <br/> - `'daterange'`\n *\n * @defaultValue `''`\n */\n format?: string;\n\n /**\n * The source URL of the text track.\n */\n src: string;\n\n /**\n * The language of the text track.\n */\n srclang?: string;\n\n /**\n * A label for the text track.\n *\n * @remarks\n * <br/> - This will be used as an identifier on the player API and in the UI.\n */\n label?: string;\n\n /**\n * The identifier of this text track.\n *\n * @internal\n */\n // Note: This works for HLS, but not for DASH.\n id?: string;\n\n /**\n * The PTS value used to sync the track with the video.\n *\n * @internal\n * \n * @remarks\n * <br/> - Available on iOS.\n */\n subtitlePTS?: string;\n\n /**\n * The localTime that matches the PTS value that is used to sync the track with the video.\n *\n * @internal\n * @remarks\n * <br/> - Available on iOS. \n * <br/> - Format: \"HH:mm:mm:SSS\" \n * <br/> - Default value is \"00:00:00:000\"\n */\n subtitleLocaltime?: string;\n}\n\n/**\n * Represents the common properties of a media resource.\n *\n * @public\n */\nexport interface BaseSource {\n\n /**\n * The cross-origin setting of the source.\n *\n * @defaultValue `''`\n */\n crossOrigin?: CrossOriginSetting;\n\n /**\n * The URL of a time server used by the player to synchronise the time in DASH sources.\n *\n * @remarks\n * <br/> - Available since v2.47.0.\n * <br/> - The time server should return time in ISO-8601 format.\n * <br/> - Overrides the time server provided the DASH manifest's `<UTCTiming>`.\n * <br/> - Only this source will use the time server. Alternatively, for all source use {@link SourceConfiguration.timeServer}.\n */\n timeServer?: string;\n\n /**\n * Whether the source should be played in the low-latency-mode of the player.\n *\n * @defaultValue `false`\n *\n * @remarks\n * <br/> - This setting must be `true` when using Low-Latency CMAF with ABR.\n * <br/> - Available since v2.62.0.\n */\n lowLatency?: boolean;\n\n /**\n * The configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.79.0.\n * <br/> - Ignored for non-DASH streams.\n */\n dash?: DashPlaybackConfiguration;\n\n /**\n * The configuration for controlling playback of an HLS stream.\n *\n * @remarks\n * <br/> - Available since v2.82.0.\n * <br/> - Ignored for non-HLS streams.\n */\n hls?: HlsPlaybackConfiguration;\n}\n\n/**\n * Represents a media resource characterized by a URL to the resource and optionally information about the resource.\n *\n * @public\n */\nexport interface TypedSource extends BaseSource {\n /**\n * The source URL of the media resource.\n *\n * @remarks\n * <br/> - Required if the `ssai` property is absent.\n * <br/> - Available since v2.4.0.\n */\n src?: string;\n\n /**\n * The content type (MIME type) of the media resource, represented by a value from the following list:\n * <br/> - `'application/dash+xml'`: The media resource is an MPEG-DASH stream.\n * <br/> - `'application/x-mpegURL'` or `'application/vnd.apple.mpegurl'`: The media resource is an HLS stream.\n * <br/> - `'video/mp4'`, `'video/webm'` and other formats: The media resource should use native HTML5 playback if supported by the browser.\n * <br/> - `'application/vnd.theo.hesp+json'`: The media resource is an HESP stream.\n *\n * @remarks\n * <br/> - Available since v2.4.0.\n */\n type?: string;\n\n /**\n * The content protection parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.15.0.\n */\n contentProtection?: DRMConfiguration;\n\n /**\n * The Server-side Ad Insertion parameters for the media resource.\n *\n * @remarks\n * <br/> - Available since v2.12.0.\n */\n ssai?: ServerSideAdInsertionConfiguration;\n}\n"],"mappings":""}
@@ -202,6 +202,25 @@ export interface TextTrackDescription {
202
202
  * @internal
203
203
  */
204
204
  id?: string;
205
+ /**
206
+ * The PTS value used to sync the track with the video.
207
+ *
208
+ * @internal
209
+ *
210
+ * @remarks
211
+ * <br/> - Available on iOS.
212
+ */
213
+ subtitlePTS?: string;
214
+ /**
215
+ * The localTime that matches the PTS value that is used to sync the track with the video.
216
+ *
217
+ * @internal
218
+ * @remarks
219
+ * <br/> - Available on iOS.
220
+ * <br/> - Format: "HH:mm:mm:SSS"
221
+ * <br/> - Default value is "00:00:00:000"
222
+ */
223
+ subtitleLocaltime?: string;
205
224
  }
206
225
  /**
207
226
  * Represents the common properties of a media resource.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-theoplayer",
3
- "version": "2.15.0",
3
+ "version": "2.16.1",
4
4
  "description": "A THEOplayer video component for react-native.",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -47,7 +47,7 @@ Pod::Spec.new do |s|
47
47
  end
48
48
  if theofeatures.include?("SIDELOADED_TEXTTRACKS")
49
49
  puts "Adding THEOplayer-Connector-SideloadedSubtitle"
50
- s.dependency "THEOplayer-Connector-SideloadedSubtitle", "6.0"
50
+ s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 6.0.1"
51
51
  end
52
52
  end
53
53
 
@@ -221,6 +221,27 @@ export interface TextTrackDescription {
221
221
  */
222
222
  // Note: This works for HLS, but not for DASH.
223
223
  id?: string;
224
+
225
+ /**
226
+ * The PTS value used to sync the track with the video.
227
+ *
228
+ * @internal
229
+ *
230
+ * @remarks
231
+ * <br/> - Available on iOS.
232
+ */
233
+ subtitlePTS?: string;
234
+
235
+ /**
236
+ * The localTime that matches the PTS value that is used to sync the track with the video.
237
+ *
238
+ * @internal
239
+ * @remarks
240
+ * <br/> - Available on iOS.
241
+ * <br/> - Format: "HH:mm:mm:SSS"
242
+ * <br/> - Default value is "00:00:00:000"
243
+ */
244
+ subtitleLocaltime?: string;
224
245
  }
225
246
 
226
247
  /**