react-native-theoplayer 1.3.0 → 1.5.0

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.
Files changed (192) hide show
  1. package/android/src/main/java/com/theoplayer/SourceHelper.java +92 -5
  2. package/ios/THEOplayerRCTBridge.m +2 -0
  3. package/ios/THEOplayerRCTDebug.swift +1 -1
  4. package/ios/THEOplayerRCTView.swift +6 -3
  5. package/ios/THEOplayerRCTViewEventHandler.swift +1 -1
  6. package/ios/THEOplayerRCTViewManager.swift +9 -1
  7. package/ios/Theoplayer-Bridging-Header.h +1 -0
  8. package/ios/style.css +5 -0
  9. package/lib/commonjs/api/THEOplayerView.js.map +1 -1
  10. package/lib/commonjs/api/barrel.js.map +1 -1
  11. package/lib/commonjs/api/config/PlayerConfiguration.js.map +1 -1
  12. package/lib/commonjs/api/config/barrel.js.map +1 -1
  13. package/lib/commonjs/api/error/PlayerError.js.map +1 -1
  14. package/lib/commonjs/api/error/barrel.js.map +1 -1
  15. package/lib/commonjs/api/event/PlayerEvent.js.map +1 -1
  16. package/lib/commonjs/api/event/TrackEvent.js.map +1 -1
  17. package/lib/commonjs/api/event/barrel.js.map +1 -1
  18. package/lib/commonjs/api/source/SourceDescription.js.map +1 -1
  19. package/lib/commonjs/api/source/ads/Ads.js.map +1 -1
  20. package/lib/commonjs/api/source/barrel.js.map +1 -1
  21. package/lib/commonjs/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
  22. package/lib/commonjs/api/source/dash/barrel.js.map +1 -1
  23. package/lib/commonjs/api/source/drm/DRMConfiguration.js.map +1 -1
  24. package/lib/commonjs/api/source/drm/barrel.js.map +1 -1
  25. package/lib/commonjs/api/source/hls/HlsPlaybackConfiguration.js.map +1 -1
  26. package/lib/commonjs/api/source/hls/barrel.js.map +1 -1
  27. package/lib/commonjs/api/timeranges/TimeRange.js.map +1 -1
  28. package/lib/commonjs/api/timeranges/barrel.js.map +1 -1
  29. package/lib/commonjs/api/track/MediaTrack.js.map +1 -1
  30. package/lib/commonjs/api/track/Quality.js.map +1 -1
  31. package/lib/commonjs/api/track/TextTrack.js.map +1 -1
  32. package/lib/commonjs/api/track/TextTrackCue.js.map +1 -1
  33. package/lib/commonjs/api/track/Track.js.map +1 -1
  34. package/lib/commonjs/api/track/barrel.js.map +1 -1
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/internal/THEOplayerView.js +16 -1
  37. package/lib/commonjs/internal/THEOplayerView.js.map +1 -1
  38. package/lib/commonjs/internal/THEOplayerView.style.js.map +1 -1
  39. package/lib/commonjs/internal/THEOplayerView.web.js.map +1 -1
  40. package/lib/commonjs/internal/web/TrackUtils.js.map +1 -1
  41. package/lib/module/api/THEOplayerView.js.map +1 -1
  42. package/lib/module/api/barrel.js.map +1 -1
  43. package/lib/module/api/config/PlayerConfiguration.js.map +1 -1
  44. package/lib/module/api/config/barrel.js.map +1 -1
  45. package/lib/module/api/error/PlayerError.js.map +1 -1
  46. package/lib/module/api/error/barrel.js.map +1 -1
  47. package/lib/module/api/event/PlayerEvent.js.map +1 -1
  48. package/lib/module/api/event/TrackEvent.js.map +1 -1
  49. package/lib/module/api/event/barrel.js.map +1 -1
  50. package/lib/module/api/source/SourceDescription.js.map +1 -1
  51. package/lib/module/api/source/ads/Ads.js.map +1 -1
  52. package/lib/module/api/source/barrel.js.map +1 -1
  53. package/lib/module/api/source/dash/DashPlaybackConfiguration.js.map +1 -1
  54. package/lib/module/api/source/dash/barrel.js.map +1 -1
  55. package/lib/module/api/source/drm/DRMConfiguration.js.map +1 -1
  56. package/lib/module/api/source/drm/barrel.js.map +1 -1
  57. package/lib/module/api/source/hls/HlsPlaybackConfiguration.js.map +1 -1
  58. package/lib/module/api/source/hls/barrel.js.map +1 -1
  59. package/lib/module/api/timeranges/TimeRange.js.map +1 -1
  60. package/lib/module/api/timeranges/barrel.js.map +1 -1
  61. package/lib/module/api/track/MediaTrack.js.map +1 -1
  62. package/lib/module/api/track/Quality.js.map +1 -1
  63. package/lib/module/api/track/TextTrack.js.map +1 -1
  64. package/lib/module/api/track/TextTrackCue.js.map +1 -1
  65. package/lib/module/api/track/Track.js.map +1 -1
  66. package/lib/module/api/track/barrel.js.map +1 -1
  67. package/lib/module/index.js.map +1 -1
  68. package/lib/module/internal/THEOplayerView.js +16 -2
  69. package/lib/module/internal/THEOplayerView.js.map +1 -1
  70. package/lib/module/internal/THEOplayerView.style.js.map +1 -1
  71. package/lib/module/internal/THEOplayerView.web.js.map +1 -1
  72. package/lib/module/internal/web/TrackUtils.js.map +1 -1
  73. package/lib/typescript/lib/commonjs/api/THEOplayerView.d.ts +1 -1
  74. package/lib/typescript/lib/commonjs/api/barrel.d.ts +1 -1
  75. package/lib/typescript/lib/commonjs/api/config/barrel.d.ts +1 -1
  76. package/lib/typescript/lib/commonjs/api/error/barrel.d.ts +1 -1
  77. package/lib/typescript/lib/commonjs/api/event/PlayerEvent.d.ts +1 -1
  78. package/lib/typescript/lib/commonjs/api/event/TrackEvent.d.ts +3 -3
  79. package/lib/typescript/lib/commonjs/api/event/barrel.d.ts +1 -1
  80. package/lib/typescript/lib/commonjs/api/source/SourceDescription.d.ts +1 -1
  81. package/lib/typescript/lib/commonjs/api/source/barrel.d.ts +1 -1
  82. package/lib/typescript/lib/commonjs/api/source/dash/barrel.d.ts +1 -1
  83. package/lib/typescript/lib/commonjs/api/source/drm/barrel.d.ts +1 -1
  84. package/lib/typescript/lib/commonjs/api/source/hls/barrel.d.ts +1 -1
  85. package/lib/typescript/lib/commonjs/api/timeranges/barrel.d.ts +1 -1
  86. package/lib/typescript/lib/commonjs/api/track/MediaTrack.d.ts +1 -1
  87. package/lib/typescript/lib/commonjs/api/track/TextTrack.d.ts +1 -1
  88. package/lib/typescript/lib/commonjs/api/track/barrel.d.ts +1 -1
  89. package/lib/typescript/lib/commonjs/index.d.ts +2 -2
  90. package/lib/typescript/lib/commonjs/internal/THEOplayerView.d.ts +3 -1
  91. package/lib/typescript/lib/commonjs/internal/THEOplayerView.style.d.ts +1 -1
  92. package/lib/typescript/lib/commonjs/internal/THEOplayerView.web.d.ts +1 -1
  93. package/lib/typescript/lib/commonjs/internal/web/TrackUtils.d.ts +1 -1
  94. package/lib/typescript/lib/module/internal/THEOplayerView.d.ts +5 -0
  95. package/lib/typescript/lib/module/internal/THEOplayerView.web.d.ts +8 -1
  96. package/lib/typescript/src/internal/THEOplayerView.d.ts +2 -0
  97. package/package.json +1 -1
  98. package/react-native-theoplayer.podspec +1 -0
  99. package/src/internal/THEOplayerView.tsx +15 -1
  100. package/android/.gradle/7.0.2/dependencies-accessors/dependencies-accessors.lock +0 -0
  101. package/android/.gradle/7.0.2/dependencies-accessors/gc.properties +0 -0
  102. package/android/.gradle/7.0.2/executionHistory/executionHistory.lock +0 -0
  103. package/android/.gradle/7.0.2/fileChanges/last-build.bin +0 -0
  104. package/android/.gradle/7.0.2/fileHashes/fileHashes.bin +0 -0
  105. package/android/.gradle/7.0.2/fileHashes/fileHashes.lock +0 -0
  106. package/android/.gradle/7.0.2/gc.properties +0 -0
  107. package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  108. package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
  109. package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
  110. package/android/.gradle/checksums/checksums.lock +0 -0
  111. package/android/.gradle/checksums/md5-checksums.bin +0 -0
  112. package/android/.gradle/checksums/sha1-checksums.bin +0 -0
  113. package/android/.gradle/vcs-1/gc.properties +0 -0
  114. package/android/.idea/compiler.xml +0 -6
  115. package/android/.idea/gradle.xml +0 -18
  116. package/android/.idea/jarRepositories.xml +0 -40
  117. package/android/.idea/libraries/Gradle__androidx_activity_activity_1_1_0_aar.xml +0 -13
  118. package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_2_0.xml +0 -11
  119. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_1_0_aar.xml +0 -16
  120. package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_resources_1_1_0_aar.xml +0 -13
  121. package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_1_0.xml +0 -11
  122. package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_1_0_aar.xml +0 -13
  123. package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +0 -13
  124. package/android/.idea/libraries/Gradle__androidx_browser_browser_1_3_0_aar.xml +0 -16
  125. package/android/.idea/libraries/Gradle__androidx_collection_collection_1_1_0.xml +0 -11
  126. package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +0 -16
  127. package/android/.idea/libraries/Gradle__androidx_core_core_1_2_0_aar.xml +0 -16
  128. package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +0 -13
  129. package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +0 -13
  130. package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +0 -13
  131. package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +0 -16
  132. package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_2_4_aar.xml +0 -16
  133. package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +0 -13
  134. package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +0 -13
  135. package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +0 -13
  136. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_2_0.xml +0 -11
  137. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +0 -13
  138. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_2_0_aar.xml +0 -13
  139. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_2_0_aar.xml +0 -13
  140. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_2_0_aar.xml +0 -13
  141. package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_savedstate_2_2_0_aar.xml +0 -13
  142. package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +0 -13
  143. package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +0 -13
  144. package/android/.idea/libraries/Gradle__androidx_preference_preference_1_1_1_aar.xml +0 -13
  145. package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +0 -16
  146. package/android/.idea/libraries/Gradle__androidx_recyclerview_recyclerview_1_0_0_aar.xml +0 -16
  147. package/android/.idea/libraries/Gradle__androidx_savedstate_savedstate_1_0_0_aar.xml +0 -13
  148. package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +0 -13
  149. package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +0 -16
  150. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_1_0_aar.xml +0 -13
  151. package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_1_0_aar.xml +0 -13
  152. package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +0 -13
  153. package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +0 -13
  154. package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_java_only_0_0_3.xml +0 -13
  155. package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_0_0_aar.xml +0 -15
  156. package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_0_0_aar.xml +0 -18
  157. package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_0_0_aar.xml +0 -18
  158. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_0_0_aar.xml +0 -18
  159. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_0_0_aar.xml +0 -18
  160. package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_0_0_aar.xml +0 -15
  161. package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_0_0_aar.xml +0 -15
  162. package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_0_0_aar.xml +0 -15
  163. package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_11_2.xml +0 -13
  164. package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_64_2_aar.xml +0 -18
  165. package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_9_0.xml +0 -13
  166. package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_9_0.xml +0 -13
  167. package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_9_0_aar.xml +0 -15
  168. package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_14_1.xml +0 -13
  169. package/android/.idea/libraries/Gradle__com_google_ads_interactivemedia_v3_interactivemedia_3_25_1.xml +0 -9
  170. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_ads_identifier_17_1_0_aar.xml +0 -13
  171. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_appset_16_0_0_aar.xml +0 -13
  172. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_base_17_6_0_aar.xml +0 -13
  173. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_basement_17_6_0_aar.xml +0 -13
  174. package/android/.idea/libraries/Gradle__com_google_android_gms_play_services_tasks_17_2_1_aar.xml +0 -13
  175. package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +0 -13
  176. package/android/.idea/libraries/Gradle__com_google_code_gson_gson_2_8_2.xml +0 -13
  177. package/android/.idea/libraries/Gradle__com_google_guava_listenablefuture_1_0.xml +0 -13
  178. package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_3_12_12.xml +0 -13
  179. package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_3_12_12.xml +0 -13
  180. package/android/.idea/libraries/Gradle__com_squareup_okio_okio_1_17_5.xml +0 -13
  181. package/android/.idea/libraries/Gradle__com_theoplayer_theoplayer_sdk_android_unified_3_6_1_aar.xml +0 -12
  182. package/android/.idea/libraries/Gradle__com_theoplayer_theoplayer_sdk_android_unified_ads_3_6_1_aar.xml +0 -11
  183. package/android/.idea/libraries/Gradle__com_theoplayer_theoplayer_sdk_android_unified_ads_ima_3_6_1_aar.xml +0 -11
  184. package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +0 -13
  185. package/android/.idea/misc.xml +0 -9
  186. package/android/.idea/modules/android.androidTest.iml +0 -105
  187. package/android/.idea/modules/android.iml +0 -40
  188. package/android/.idea/modules/android.main.iml +0 -113
  189. package/android/.idea/modules/android.unitTest.iml +0 -100
  190. package/android/.idea/modules.xml +0 -11
  191. package/android/.idea/vcs.xml +0 -6
  192. package/android/local.properties +0 -8
@@ -1,12 +1,14 @@
1
1
  package com.theoplayer;
2
2
 
3
+ import android.text.TextUtils;
4
+ import android.util.Log;
5
+
3
6
  import androidx.annotation.NonNull;
4
7
  import androidx.annotation.Nullable;
5
8
 
6
9
  import com.facebook.react.bridge.ReadableArray;
7
10
  import com.facebook.react.bridge.ReadableMap;
8
11
  import com.google.gson.Gson;
9
- import com.theoplayer.android.api.player.track.texttrack.TextTrack;
10
12
  import com.theoplayer.android.api.player.track.texttrack.TextTrackKind;
11
13
  import com.theoplayer.android.api.source.SourceDescription;
12
14
  import com.theoplayer.android.api.source.SourceType;
@@ -15,12 +17,22 @@ import com.theoplayer.android.api.source.TypedSource;
15
17
  import com.theoplayer.android.api.source.addescription.AdDescription;
16
18
  import com.theoplayer.android.api.source.addescription.GoogleImaAdDescription;
17
19
  import com.theoplayer.android.api.source.drm.DRMConfiguration;
20
+ import com.theoplayer.android.api.source.drm.DRMIntegrationId;
21
+ import com.theoplayer.android.api.source.drm.preintegration.AxinomDRMConfiguration;
22
+ import com.theoplayer.android.api.source.drm.preintegration.AzureDRMConfiguration;
23
+ import com.theoplayer.android.api.source.drm.preintegration.ConaxDRMConfiguration;
24
+ import com.theoplayer.android.api.source.drm.preintegration.DRMTodayConfiguration;
25
+ import com.theoplayer.android.api.source.drm.preintegration.IrdetoConfiguration;
26
+ import com.theoplayer.android.api.source.drm.preintegration.KeyOSDRMConfiguration;
27
+ import com.theoplayer.android.api.source.drm.preintegration.TitaniumDRMConfiguration;
28
+ import com.theoplayer.android.api.source.drm.preintegration.VudrmDRMConfiguration;
29
+ import com.theoplayer.android.api.source.drm.preintegration.XstreamConfiguration;
30
+ import com.theoplayer.android.api.source.hls.HlsPlaybackConfiguration;
18
31
 
19
32
  import org.json.JSONArray;
20
33
  import org.json.JSONException;
21
34
  import org.json.JSONObject;
22
35
 
23
- import java.lang.reflect.Array;
24
36
  import java.util.ArrayList;
25
37
  import java.util.HashMap;
26
38
  import java.util.Map;
@@ -30,6 +42,15 @@ import java.util.Map;
30
42
  */
31
43
  public class SourceHelper {
32
44
 
45
+ private static final String TAG = "SourceHelper";
46
+
47
+ private static final String PROP_CONTENT_PROTECTION = "contentProtection";
48
+ private static final String PROP_CONTENT_PROTECTION_INTEGRATION = "integration";
49
+ private static final String PROP_LIVE_OFFSET = "liveOffset";
50
+ private static final String PROP_HLS_DATERANGE = "hlsDateRange";
51
+ private static final String PROP_HLS_PLAYBACK_CONFIG = "hls";
52
+ private static final String PROP_TIME_SERVER = "timeServer";
53
+
33
54
  private final Gson gson = new Gson();
34
55
 
35
56
  public SourceDescription parseSourceFromJS(ReadableMap source) {
@@ -106,10 +127,58 @@ public class SourceHelper {
106
127
  if (sourceType != null) {
107
128
  tsBuilder.type(sourceType);
108
129
  }
130
+ if (jsonTypedSource.has(PROP_LIVE_OFFSET)) {
131
+ tsBuilder.liveOffset(jsonTypedSource.getDouble(PROP_LIVE_OFFSET));
132
+ }
133
+ if (jsonTypedSource.has(PROP_HLS_DATERANGE)) {
134
+ tsBuilder.hlsDateRange(jsonTypedSource.getBoolean(PROP_HLS_DATERANGE));
135
+ }
136
+ if (jsonTypedSource.has(PROP_HLS_PLAYBACK_CONFIG)) {
137
+ HlsPlaybackConfiguration hlsConfig =
138
+ gson.fromJson(jsonTypedSource.get(PROP_HLS_PLAYBACK_CONFIG).toString(), HlsPlaybackConfiguration.class);
139
+ tsBuilder.hls(hlsConfig);
140
+ }
141
+ if (jsonTypedSource.has(PROP_TIME_SERVER)) {
142
+ tsBuilder.timeServer(jsonTypedSource.getString(PROP_TIME_SERVER));
143
+ }
144
+ if (jsonTypedSource.has(PROP_CONTENT_PROTECTION)) {
145
+ JSONObject contentProtection = jsonTypedSource.getJSONObject(PROP_CONTENT_PROTECTION);
109
146
 
110
- if (jsonTypedSource.has("contentProtection")) {
111
- DRMConfiguration drmConfiguration = gson.fromJson(jsonTypedSource.get("contentProtection").toString(), DRMConfiguration.class);
112
- tsBuilder.drm(drmConfiguration);
147
+ // Look for specific DRM pre-integration, otherwise use default.
148
+ final String integration = contentProtection.optString(PROP_CONTENT_PROTECTION_INTEGRATION);
149
+ DRMIntegrationId integrationId = null;
150
+ if (!TextUtils.isEmpty(integration)) {
151
+ integrationId = DRMIntegrationId.from(integration);
152
+ if (integrationId == null) {
153
+ Log.e(TAG, "ContentProtection integration not supported: " + integration);
154
+ }
155
+ }
156
+ if (integrationId != null) {
157
+ switch (integrationId) {
158
+ case AXINOM:
159
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), AxinomDRMConfiguration.class)); break;
160
+ case AZURE:
161
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), AzureDRMConfiguration.class)); break;
162
+ case CONAX:
163
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), ConaxDRMConfiguration.class)); break;
164
+ case DRMTODAY:
165
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), DRMTodayConfiguration.class)); break;
166
+ case IRDETO:
167
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), IrdetoConfiguration.class)); break;
168
+ case KEYOS:
169
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), KeyOSDRMConfiguration.class)); break;
170
+ case TITANIUM:
171
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), TitaniumDRMConfiguration.class)); break;
172
+ case VUDRM:
173
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), VudrmDRMConfiguration.class)); break;
174
+ case XSTREAM:
175
+ tsBuilder.drm(gson.fromJson(contentProtection.toString(), XstreamConfiguration.class)); break;
176
+ default:
177
+ Log.e(TAG, "ContentProtection integration not supported: " + integration);
178
+ }
179
+ } else {
180
+ tsBuilder.drm(gson.fromJson(jsonTypedSource.get(PROP_CONTENT_PROTECTION).toString(), DRMConfiguration.class));
181
+ }
113
182
  }
114
183
  return tsBuilder.build();
115
184
  }
@@ -137,6 +206,24 @@ public class SourceHelper {
137
206
  if ("video/mp4".equals(type)) {
138
207
  return SourceType.MP4;
139
208
  }
209
+ if ("audio/mpeg".equals(type)) {
210
+ return SourceType.MP3;
211
+ }
212
+ } else {
213
+ // No type given, check for known extension.
214
+ String src = jsonTypedSource.optString("src");
215
+ if (src.endsWith(".mpd")) {
216
+ return SourceType.DASH;
217
+ }
218
+ if (src.endsWith(".m3u8")) {
219
+ return SourceType.HLSX;
220
+ }
221
+ if (src.endsWith(".mp4")) {
222
+ return SourceType.MP4;
223
+ }
224
+ if (src.endsWith(".mp3")) {
225
+ return SourceType.MP3;
226
+ }
140
227
  }
141
228
  return null;
142
229
  }
@@ -43,4 +43,6 @@ RCT_EXPORT_VIEW_PROPERTY(onNativeFullscreenPlayerDidDismiss, RCTDirectEventBlock
43
43
  RCT_EXPORT_VIEW_PROPERTY(onNativeTextTrackListEvent, RCTDirectEventBlock);
44
44
  RCT_EXPORT_VIEW_PROPERTY(onNativeTextTrackEvent, RCTDirectEventBlock);
45
45
 
46
+ RCT_EXTERN_METHOD(destroy:(nonnull NSNumber *)node);
47
+
46
48
  @end
@@ -1,7 +1,7 @@
1
1
  // THEOplayerRCTDebug.swift
2
2
 
3
3
  // General debug flag, if set to false none of the debug prints will appear
4
- let DEBUG = true
4
+ let DEBUG = false
5
5
 
6
6
  // Debug flag to monitor incoming Theoplayer events
7
7
  let DEBUG_THEOPLAYER_EVENTS = DEBUG && true
@@ -32,10 +32,11 @@ class THEOplayerRCTView: UIView {
32
32
  super.init(frame: .zero)
33
33
  }
34
34
 
35
- deinit {
35
+ func destroy() {
36
36
  self.eventHandler.destroy()
37
37
  self.player?.destroy()
38
38
  self.player = nil
39
+ if DEBUG_THEOPLAYER_INTERACTION { print("[NATIVE] THEOplayer instance destroyed.") }
39
40
  }
40
41
 
41
42
  required init?(coder aDecoder: NSCoder) {
@@ -82,11 +83,13 @@ class THEOplayerRCTView: UIView {
82
83
  if (self.player == nil) {
83
84
  // 'lazy' init THEOplayer instance, performed on next runloop, to make sure all props have been set (license config is needed to init player)
84
85
  DispatchQueue.main.async {
85
- if DEBUG_THEOPLAYER_INTERACTION { print("[NATIVE] 'lazy' init THEOplayer intance") }
86
+ if DEBUG_THEOPLAYER_INTERACTION { print("[NATIVE] 'lazy' init THEOplayer instance") }
86
87
  #if os(tvOS)
87
88
  self.player = THEOplayer(configuration: THEOplayerConfiguration(chromeless: self.chromeless, license: self.license, licenseUrl: self.licenseUrl, pip: nil))
88
89
  #else
89
- self.player = THEOplayer(configuration: THEOplayerConfiguration(chromeless: self.chromeless, pip: nil, license: self.license, licenseUrl: self.licenseUrl))
90
+ let stylePath = Bundle.main.path(forResource:"style", ofType: "css")
91
+ let cssPaths = stylePath != nil ? [stylePath!] : []
92
+ self.player = THEOplayer(configuration: THEOplayerConfiguration(chromeless: self.chromeless, cssPaths: cssPaths, pip: nil, license: self.license, licenseUrl: self.licenseUrl))
90
93
  #endif
91
94
  if let player = self.player {
92
95
  // couple player instance to event handler
@@ -145,7 +145,7 @@ class THEOplayerRCTViewEventHandler {
145
145
  if let forwardedDurationChangeEvent = self?.onNativeDurationChange {
146
146
  forwardedDurationChangeEvent(
147
147
  [
148
- "duration": event.duration ?? 0.0
148
+ "duration": (event.duration ?? 0.0) * 1000 // sec -> msec
149
149
  ]
150
150
  )
151
151
  }
@@ -14,10 +14,18 @@ class THEOplayerRCTViewManager: RCTViewManager {
14
14
 
15
15
  override func view() -> UIView! {
16
16
  return THEOplayerRCTView();
17
- }
17
+ }
18
18
 
19
19
  override class func requiresMainQueueSetup() -> Bool {
20
20
  return true
21
21
  }
22
22
 
23
+ @objc func destroy(_ node: NSNumber) {
24
+ DispatchQueue.main.async {
25
+ let theView = self.bridge.uiManager.view(
26
+ forReactTag: node
27
+ ) as! THEOplayerRCTView
28
+ theView.destroy()
29
+ }
30
+ }
23
31
  }
@@ -3,3 +3,4 @@
3
3
  //
4
4
 
5
5
  #import <React/RCTViewManager.h>
6
+ #import "React/RCTUIManager.h"
package/ios/style.css ADDED
@@ -0,0 +1,5 @@
1
+ div.theoplayer-webvtt-region-default {
2
+ margin: 0px !important;
3
+ bottom: 1em !important;
4
+ }
5
+
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["THEOplayerView.ts"],"sourcesContent":["import type { SourceDescription } from './source/SourceDescription';\nimport type { StyleProp, ViewStyle } from 'react-native';\nimport type {\n DurationChangeEvent,\n ErrorEvent,\n LoadedMetadataEvent,\n ReadyStateChangeEvent,\n TimeUpdateEvent,\n ProgressEvent,\n SegmentNotFoundEvent,\n} from './event/PlayerEvent';\nimport type { TextTrackEvent, TextTrackListEvent } from './event/TrackEvent';\nimport type { HostComponent } from 'react-native';\nimport type { PlayerConfiguration } from './config/PlayerConfiguration';\n\nexport interface THEOplayerViewProps {\n /**\n * The player configuration with THEOplayer license.\n */\n config?: PlayerConfiguration;\n\n /**\n * A source description that determines the current media resource.\n */\n source: SourceDescription;\n\n /**\n * Used to set the player's paused state.\n *\n * @remarks\n * <br/> - If paused is initially set to `true`, play-out will start once the source is set.\n */\n paused?: boolean;\n\n /**\n * Used to set the playback rate of the media.\n *\n * @example\n * <br/> - `playbackRate = 0.70` will slow down the playback rate of the media by 30%.\n * <br/> - `playbackRate = 1.25` will speed up the playback rate of the media by 25%.\n *\n * @remarks\n * <br/> - Playback rate is represented by a number where `1` is default playback speed.\n * <br/> - Playback rate must be a positive number.\n * <br/> - It is recommended that you limit the range to between 0.5 and 4.\n */\n playbackRate?: number;\n\n /**\n * Used to set the volume of the audio.\n *\n * @remarks\n * <br/> - Volume is represented by a floating point number between `0.0` and `1.0`.\n */\n volume?: number;\n\n /**\n * Determines whether audio is muted.\n */\n muted?: boolean;\n\n /**\n * Determines whether the player is currently playing in fullscreen.\n */\n fullscreen?: boolean;\n\n /**\n * Used to set the current selected text track by passing its `uid`, or `null` to select none.\n */\n selectedTextTrack?: number | null;\n\n /**\n * Used to set the current selected video track by passing its `uid`, or `null` to select none.\n */\n selectedVideoTrack?: number | null;\n\n /**\n * Used to set the current selected audio track by passing its `uid`, or `null` to select none.\n */\n selectedAudioTrack?: number | null;\n\n /**\n * The style applied to the player view.\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Invoked before the player goes to fullscreen.\n */\n onFullscreenPlayerWillPresent?: () => void;\n\n /**\n * Invoked after the player went to fullscreen.\n */\n onFullscreenPlayerDidPresent?: () => void;\n\n /**\n * Invoked before the player returns from fullscreen.\n */\n onFullscreenPlayerWillDismiss?: () => void;\n\n /**\n * Invoked after the player returned from fullscreen.\n */\n onFullscreenPlayerDidDismiss?: () => void;\n\n /**\n * Invoked when the player's buffering state has changed.\n *\n * @remarks\n * <br/> - The `isBuffering` value is typically coupled to showing/hiding a loading indicator.\n *\n * @param isBuffering A value that indicates whether the player is buffering.\n */\n onBufferingStateChange?: (isBuffering: boolean) => void;\n\n /**\n * Invoked when the player receives a new source description.\n */\n onSourceChange?: () => void;\n\n /**\n * Invoked when the player starts loading the manifest.\n */\n onLoadStart?: () => void;\n\n /**\n * Invoked when the player has determined the duration and dimensions of the\n * media resource, and the text and media tracks are ready.\n */\n onLoadedMetadata?: (event: LoadedMetadataEvent) => void;\n\n /**\n * Invoked when the player can render the media data at the current playback position for the first time.\n */\n onLoadedData?: () => void;\n\n /**\n * Invoked when the player's readyState has changed.\n */\n onReadyStateChange?: (event: ReadyStateChangeEvent) => void;\n\n /**\n * Invoked when an error occurs.\n */\n onError?: (event: ErrorEvent) => void;\n\n /**\n * Invoked each time the player has loaded media data.\n */\n onProgress?: (event: ProgressEvent) => void;\n\n /**\n * Invoked when the player's internal paused state changes to `false`.\n */\n onPlay?: () => void;\n\n /**\n * Invoked when playback is ready to start after having been paused or delayed due to\n * lack of media data.\n */\n onPlaying?: () => void;\n\n /**\n * Invoked when the player's internal paused state changes to `true`.\n */\n onPause?: () => void;\n\n /**\n * Invoked when a seek operation starts and the player is seeking a new position.\n */\n onSeeking?: () => void;\n\n /**\n * Invoked when a seek operation completed and the current playback position has changed\n */\n onSeeked?: () => void;\n\n /**\n * Invoked when playback has stopped because the end of the media was reached or because\n * no further data is available.\n */\n onEnded?: () => void;\n\n /**\n * Invoked when the current playback position changed.\n */\n onTimeUpdate?: (event: TimeUpdateEvent) => void;\n\n /**\n * Invoked when the player's duration attribute has been updated.\n */\n onDurationChange?: (event: DurationChangeEvent) => void;\n\n /**\n * Invoked when a segment can not be found.\n *\n * @remarks\n * <br/> - Only dispatched on DASH streams.\n */\n onSegmentNotFound?: (event: SegmentNotFoundEvent) => void;\n\n /**\n * Invoked when a text track list event occurs.\n */\n onTextTrackListEvent?: (event: TextTrackListEvent) => void;\n\n /**\n * Invoked when a text track event occurs.\n */\n onTextTrackEvent?: (event: TextTrackEvent) => void;\n}\n\nexport interface THEOplayerViewComponent extends HostComponent<THEOplayerViewProps> {\n /**\n * Seek to a new position.\n *\n * @param seekTime - new time, in milliseconds.\n */\n seek: (seekTime: number) => void;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './error/barrel';\nexport * from './event/barrel';\nexport * from './source/barrel';\nexport * from './timeranges/barrel';\nexport * from './track/barrel';\nexport * from './config/barrel';\nexport * from './THEOplayerView';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './error/barrel';\nexport * from './event/barrel';\nexport * from './source/barrel';\nexport * from './timeranges/barrel';\nexport * from './track/barrel';\nexport * from './config/barrel';\nexport * from './THEOplayerView';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["PlayerConfiguration.ts"],"sourcesContent":["export interface PlayerConfiguration {\n /**\n * The license for the player\n */\n readonly license?: string;\n\n /**\n * The url to fetch the license for the player\n */\n readonly licenseUrl?: string;\n\n /**\n * Sets whether the native player is chromeless (without UI).\n */\n readonly chromeless?: boolean;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './PlayerConfiguration';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './PlayerConfiguration';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["PlayerError.ts"],"sourcesContent":["export interface PlayerError {\n readonly errorCode: string;\n readonly errorMessage: string;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './PlayerError';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './PlayerError';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["PlayerEvent.ts"],"sourcesContent":["import type { MediaTrack, PlayerError, TextTrack } from 'react-native-theoplayer';\nimport type { TimeRange } from '../timeranges/TimeRange';\n\nexport interface ErrorEvent {\n error: PlayerError;\n}\n\nexport interface LoadedMetadataEvent {\n textTracks: TextTrack[];\n audioTracks: MediaTrack[];\n videoTracks: MediaTrack[];\n duration: number;\n selectedTextTrack: number | undefined;\n selectedVideoTrack: number | undefined;\n selectedAudioTrack: number | undefined;\n}\n\nexport interface TimeUpdateEvent {\n /**\n * The player's current time, in msecs.\n */\n readonly currentTime: number;\n\n /**\n * The player's current program date time, in msecs.\n */\n readonly currentProgramDateTime?: number;\n}\n\nexport interface DurationChangeEvent {\n /**\n * The player's new duration, in msecs.\n */\n readonly duration: number;\n}\n\nexport interface ReadyStateChangeEvent {\n /**\n * The player's new ready state.\n */\n readonly readyState: number;\n}\n\nexport interface ProgressEvent {\n /**\n * The ranges of the media resource that are seekable by the player.\n */\n readonly seekable: TimeRange[];\n}\n\nexport interface SegmentNotFoundEvent {\n /**\n * Start time of the segment.\n */\n readonly segmentStartTime: number;\n\n /**\n * Descriptive error message.\n */\n readonly error: string;\n\n /**\n * Number of times the segment was retried.\n */\n readonly retryCount: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["TrackEvent.ts"],"names":["TrackListEventType","TextTrackEventType"],"mappings":";;;;;;IAGYA,kB;;;WAAAA,kB;AAAAA,EAAAA,kB,CAAAA,kB;AAAAA,EAAAA,kB,CAAAA,kB;GAAAA,kB,kCAAAA,kB;;IAwBAC,kB;;;WAAAA,kB;AAAAA,EAAAA,kB,CAAAA,kB;AAAAA,EAAAA,kB,CAAAA,kB;GAAAA,kB,kCAAAA,kB","sourcesContent":["import type { TextTrack } from '../track/TextTrack';\nimport type { TextTrackCue } from '../track/TextTrackCue';\n\nexport enum TrackListEventType {\n /**\n * Dispatched when track has been added to the track list.\n */\n AddTrack,\n\n /**\n * Dispatched when track has been removed from the track list.\n */\n RemoveTrack,\n}\n\nexport interface TextTrackListEvent {\n /**\n * The type of text track list event.\n */\n readonly type: TrackListEventType;\n\n /**\n * The relevant text track.\n */\n readonly track: TextTrack;\n}\n\nexport enum TextTrackEventType {\n /**\n * Dispatched when cue has been added to the text track.\n */\n AddCue,\n\n /**\n * Dispatched when cue has been removed from the text track.\n */\n RemoveCue,\n}\n\nexport interface TextTrackEvent {\n /**\n * The type of text track event.\n */\n readonly type: TextTrackEventType;\n\n /**\n * The text track's uid to which this cue belongs.\n */\n readonly trackUid: number;\n\n /**\n * The text track's cue.\n */\n readonly cue: TextTrackCue;\n}\n"]}
1
+ {"version":3,"names":["TrackListEventType","TextTrackEventType"],"sources":["TrackEvent.ts"],"sourcesContent":["import type { TextTrack } from '../track/TextTrack';\nimport type { TextTrackCue } from '../track/TextTrackCue';\n\nexport enum TrackListEventType {\n /**\n * Dispatched when track has been added to the track list.\n */\n AddTrack,\n\n /**\n * Dispatched when track has been removed from the track list.\n */\n RemoveTrack,\n}\n\nexport interface TextTrackListEvent {\n /**\n * The type of text track list event.\n */\n readonly type: TrackListEventType;\n\n /**\n * The relevant text track.\n */\n readonly track: TextTrack;\n}\n\nexport enum TextTrackEventType {\n /**\n * Dispatched when cue has been added to the text track.\n */\n AddCue,\n\n /**\n * Dispatched when cue has been removed from the text track.\n */\n RemoveCue,\n}\n\nexport interface TextTrackEvent {\n /**\n * The type of text track event.\n */\n readonly type: TextTrackEventType;\n\n /**\n * The text track's uid to which this cue belongs.\n */\n readonly trackUid: number;\n\n /**\n * The text track's cue.\n */\n readonly cue: TextTrackCue;\n}\n"],"mappings":";;;;;;IAGYA,kB;;;WAAAA,kB;EAAAA,kB,CAAAA,kB;EAAAA,kB,CAAAA,kB;GAAAA,kB,kCAAAA,kB;;IAwBAC,kB;;;WAAAA,kB;EAAAA,kB,CAAAA,kB;EAAAA,kB,CAAAA,kB;GAAAA,kB,kCAAAA,kB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './PlayerEvent';\nexport * from './TrackEvent';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './PlayerEvent';\nexport * from './TrackEvent';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
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';\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/**\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 * 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"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Ads.ts"],"sourcesContent":["/**\n * The type of ad source:\n * <br/> - `'vast'`: The source is a VAST resource.\n * <br/> - `'vmap'`: The source is a VMAP resource.\n * <br/> - `'adrule'`: The source is a Ad Rule resource.\n *\n * @remarks\n * <br/> - An ad rule is a simplified VMAP alternative only available in the Google IMA integration.\n *\n * @public\n */\nexport type AdSourceType = 'vast' | 'vmap' | 'adrule';\n\n/**\n * Describes the source of the ad.\n *\n * @public\n */\nexport interface AdSource {\n /**\n * The URL of the ad resource.\n */\n src: string;\n\n /**\n * The type of ad resource.\n *\n * @defaultValue 'vmap' when set through {@link SourceConfiguration.ads} without a time offset, otherwise 'vast'.\n */\n type?: AdSourceType;\n}\n\n/**\n * Describes an ad break request.\n *\n * @public\n */\nexport interface AdDescription {\n /**\n * The integration of the ad break.\n *\n * @defaultValue `'theo'`\n */\n integration?: AdIntegrationKind;\n\n /**\n * Whether the ad replaces playback of the content.\n *\n * @remarks\n * <br/> - When the ad ends, the content will resume at the ad break's offset plus its duration.\n *\n * @defaultValue\n * <br/> - `true` for live content,\n * <br/> - `false` for VOD content\n */\n replaceContent?: boolean;\n\n /**\n * A source which contains the location of ad resources to be scheduled.\n *\n * @remarks\n * <br/> - Important: This should *not* be an array of sources.\n * <br/> - VPAID support is limited to the `'google-ima'` integration.\n * <br/> - Not specifying this property should only happen when using a third party ad integration that uses an other system of specifying which ads to schedule\n */\n sources?: string | AdSource;\n\n /**\n * Offset after which the ad break will start.\n *\n * Possible formats:\n * <br/> - A number for the offset in seconds.\n * <br/> - `'start'` for a preroll.\n * <br/> - `'end'` for a postroll.\n * <br/> - `'HH:MM:SS.mmm'` for a timestamp in the playback window.\n * <br/> - A percentage string (XX%) for a proportion of the content duration.\n *\n * @remarks\n * <br/> - A timestamp which is not in the playback window will result in the ad break not being started.\n * <br/> - VMAP resources will ignore this value as they contain an internal offset.\n * <br/> - Since 2.18, numbers are supported for the Google IMA integration, since 2.21 other formats as well.\n *\n * @defaultValue `'start'`\n *\n */\n timeOffset?: string | number;\n}\n\n/**\n * The integration of an ad break, represented by a value from the following list:\n * <br/> - `'theo'`: Default ad playback.\n * <br/> - `'google-ima'`: {@link https://developers.google.com/interactive-media-ads/docs/sdks/html5|Google IMA} pre-integrated ad playback.\n * <br/> - `'spotx'`: {@link https://developer.spotxchange.com/|SpotX} pre-integrated ad playback.\n * <br/> - `'freewheel'`: {@link https://vi.freewheel.tv/|FreeWheel} pre-integrated ad playback.\n *\n * @remarks\n * <br/> - An empty string defaults to `'theo'`.\n *\n * @public\n */\nexport type AdIntegrationKind = '' | 'theo' | 'google-ima' | 'spotx' | 'freewheel';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './drm/barrel';\nexport * from './dash/barrel';\nexport * from './hls/barrel';\nexport * from './SourceDescription';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './drm/barrel';\nexport * from './dash/barrel';\nexport * from './hls/barrel';\nexport * from './SourceDescription';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["DashPlaybackConfiguration.ts"],"sourcesContent":["/**\n * The strategy for period switches (see {@link DashPlaybackConfiguration.useSeamlessPeriodSwitch}), represented by a value from the following list:\n * <br/> - `'auto'`: The player uses seamless switches if the platform supports it, and hard switches otherwise.\n * This is the default.\n * <br/> - `'never'`: The player never uses a seamless switch, and always uses a hard switch.\n * Use this if you notice that the player is attempting but failing to preload the next period on the current platform.\n * <br/> - `'always'`: The player always uses a seamless switch, and never uses a hard switch.\n * Use this if you notice that the player never preloads the next period, even though you know that the current platform\n * should support it.\n *\n * @public\n */\nexport type SeamlessPeriodSwitchStrategy = 'auto' | 'always' | 'never';\n\n/**\n * Represents a configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.79.0.\n *\n * @public\n */\nexport interface DashPlaybackConfiguration {\n /**\n * Whether to seamlessly switch between DASH periods.\n *\n * @remarks\n * The player supports two strategies for handling a switch between two periods in an MPEG-DASH stream:\n * <br/> - <strong>Seamless</strong>: Once the player is done buffering the current period, it immediately starts buffering the next period.\n * This requires that the current period and the next period have compatible codecs and content protection, or that the platform\n * supports buffering different codecs in a single player. Because the next period is preloaded ahead of time, this makes the actual\n * switch between periods (almost) completely seamless.\n * <br/> - <strong>Hard</strong>: The player waits until playback reaches the end of the current period before buffering and playing the next\n * period. Because the buffering is not done ahead of time, this may result in a noticeable stall at the start of the next period.\n * However, this strategy does not require any special platform support, so it works on any platform or device.\n *\n * By default, the player will automatically choose between a seamless or a hard period switch based on the codecs and content protection of\n * the two periods, and the support information reported by the platform. However, if you notice that the player makes an incorrect decision\n * on certain streams or platforms, you can use this option to override its behavior as a stopgap solution. (You should still report this\n * problem to THEOplayer support, so we can improve the player's default behavior and you can remove this override.)\n *\n * @defaultValue `'auto'`\n */\n useSeamlessPeriodSwitch?: SeamlessPeriodSwitchStrategy;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './DashPlaybackConfiguration';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './DashPlaybackConfiguration';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["DRMConfiguration.ts"],"sourcesContent":["/**\n * Describes the key system configuration.\n *\n * @public\n */\nexport interface KeySystemConfiguration {\n /**\n * Property to indicate whether the ability to persist state is required. This includes session data and any other type of state. The player will forward this information to the CDM when requesting access to the media key system.\n *\n * Available values are:\n * - \"required\": This will instruct the player to make the key sessions persistent.\n * - \"optional\": Choice of making use of a persistent key session is up to the player.\n * - \"not-allowed\": A temporary key session will be used.\n */\n persistentState?: 'required' | 'optional' | 'not-allowed';\n\n /**\n * Used to indicate if media key sessions can be shared across different instances, for example different browser profiles, player instances or applications. The player will forward this information to the CDM when requesting access to the media key system.\n * Available values are:\n * - “required”\n * - “optional”\n * - “not-allowed”\n */\n distinctiveIdentifier?: 'required' | 'optional' | 'not-allowed';\n\n /**\n * Allows to configure the robustness level required for audio data. The robustness level can be used to define the DRM security level. If the security level requested is not available on the platform, playback will fail.\n *\n * Following values are supported for Widevine:\n * - \"\": Lowest security level\n * - \"SW_SECURE_CRYPTO\": Secure decryption in software is required. This matches Widevine L3.\n * - \"SW_SECURE_DECODE\": Media data is to be decoded securely in software. This matches Widevine L3.\n * - \"HW_SECURE_CRYPTO\": Secure decryption in hardware is required. This matches Widevine L2.\n * - \"HW_SECURE_DECODE\": Media data is to be decoded securely in hardware. This matches Widevine L1.\n * - \"HW_SECURE_ALL\": The media pipeline must be decrypted and decoded securely in hardware. This matches Widevine L1.\n */\n audioRobustness?: string;\n\n /**\n * Allows to configure the robustness level required for video data. The robustness level can be used to define the DRM security level. If the security level requested is not available on the platform, playback will fail.\n *\n * Following values are supported for Widevine:\n *\n * - \"\": Lowest security level\n * - \"SW_SECURE_CRYPTO\": Secure decryption in software is required. This matches Widevine L3.\n * - \"SW_SECURE_DECODE\": Media data is to be decoded securely in software. This matches Widevine L3.\n * - \"HW_SECURE_CRYPTO\": Secure decryption in hardware is required. This matches Widevine L2.\n * - \"HW_SECURE_DECODE\": Media data is to be decoded securely in hardware. This matches Widevine L1.\n * - \"HW_SECURE_ALL\": The media pipeline must be decrypted and decoded securely in hardware. This matches Widevine L1.\n */\n videoRobustness?: string;\n\n /**\n * The licence acquisition URL.\n *\n * @remarks\n * <br/> - If provided, the player will send license requests for the intended DRM scheme to the provided value.\n * <br/> - If not provided, the player will use the default license acquisition URLs.\n */\n licenseAcquisitionURL?: string;\n\n /**\n * The licence type.\n *\n * @internal\n */\n licenseType?: LicenseType;\n\n /**\n * Record of HTTP headers for the licence acquisition request.\n * Each entry contains a header name with associated value.\n */\n headers?: { [headerName: string]: string };\n\n /**\n * Whether the player is allowed to use credentials for cross-origin requests.\n *\n * @remarks\n * <br/> - Credentials are cookies, authorization headers or TLS client certificates.\n *\n * @defaultValue `false`\n */\n useCredentials?: boolean;\n\n /**\n * Record of query parameters for the licence acquisition request.\n * Each entry contains a query parameter name with associated value.\n */\n queryParameters?: { [key: string]: any };\n\n /**\n * The certificate for the key system. This can be either an ArrayBuffer or Uint8Array containing the raw certificate bytes or a base64-encoded variant of this.\n */\n certificate?: string;\n\n /**\n * Process the certificate's request.\n *\n * @deprecated Please use {@link registerContentProtectionIntegration} and {@link ContentProtectionIntegration.onCertificateRequest} instead.\n */\n certificateRequestProcessor?: DRMProcessor;\n\n /**\n * Process the certificate's response.\n *\n * @deprecated Please use {@link registerContentProtectionIntegration} and {@link ContentProtectionIntegration.onCertificateResponse} instead.\n */\n certificateResponseProcessor?: DRMProcessor;\n\n /**\n * Process the license's request.\n *\n * @deprecated Please use {@link registerContentProtectionIntegration} and {@link ContentProtectionIntegration.onLicenseRequest} instead.\n */\n licenseRequestProcessor?: DRMProcessor;\n\n /**\n * Process the license's response.\n *\n * @deprecated Please use {@link registerContentProtectionIntegration} and {@link ContentProtectionIntegration.onLicenseResponse} instead.\n */\n licenseResponseProcessor?: DRMProcessor;\n}\n\n/**\n * The type of the licence, represented by a value from the following list:\n * <br/> - `'temporary'`\n * <br/> - `'persistent'`\n *\n * @public\n */\nexport type LicenseType = 'temporary' | 'persistent';\n\n/**\n * Describes the FairPlay key system configuration.\n *\n * @public\n */\nexport interface FairPlayKeySystemConfiguration extends KeySystemConfiguration {\n /**\n * The URL of the certificate.\n */\n certificateURL?: string;\n}\n\n/**\n * Describes the PlayReady key system configuration.\n *\n * @public\n */\nexport interface PlayReadyKeySystemConfiguration extends KeySystemConfiguration {\n /**\n * Custom data which will be passed to the CDM.\n */\n customData?: string;\n}\n\n/**\n * Describes the Widevine key system configuration.\n *\n * @public\n */\nexport type WidevineKeySystemConfiguration = KeySystemConfiguration;\n\n/**\n * A function which processes DRM data.\n *\n * @public\n */\nexport type DRMProcessor = (arrayBuffer: ArrayBuffer) => ArrayBuffer;\n\n/**\n * Describes the ClearKey key system configuration.\n *\n * @public\n */\nexport interface ClearkeyKeySystemConfiguration extends KeySystemConfiguration {\n /**\n * List of decryption keys.\n */\n keys?: ClearkeyDecryptionKey[];\n}\n\n/**\n * Describes the ClearKey decryption key.\n *\n * @public\n */\nexport interface ClearkeyDecryptionKey {\n /**\n * The identifier of the key.\n *\n * @remarks\n * <br/> - This is a base64url encoding of the octet sequence containing the key ID.\n * <br/> - See {@link https://www.w3.org/TR/encrypted-media/#clear-key-license-format | Clear Key License Format}.\n */\n id: string;\n\n /**\n * The value of the key.\n *\n * @remarks\n * <br/> - The base64url encoding of the octet sequence containing the symmetric key value.\n * <br/> - See {@link https://www.w3.org/TR/encrypted-media/#clear-key-license-format | Clear Key License Format}.\n */\n value: string;\n}\n\n/**\n * Describes the AES128 key system configuration.\n *\n * @public\n */\nexport interface AES128KeySystemConfiguration {\n /**\n * Whether the player is allowed to use credentials for cross-origin requests.\n *\n * @remarks\n * <br/> - Credentials are cookies, authorization headers or TLS client certificates.\n *\n * @defaultValue `false`\n */\n useCredentials?: true;\n}\n\n/**\n * Describes the configuration of the DRM.\n *\n * @public\n */\nexport interface DRMConfiguration {\n /**\n * The identifier of the DRM integration.\n */\n integration?: string;\n\n /**\n * The configuration of the FairPlay key system.\n */\n fairplay?: FairPlayKeySystemConfiguration;\n\n /**\n * The configuration of the PlayReady key system.\n */\n playready?: PlayReadyKeySystemConfiguration;\n\n /**\n * The configuration of the Widevine key system.\n */\n widevine?: WidevineKeySystemConfiguration;\n\n /**\n * The configuration of the ClearKey key system.\n */\n clearkey?: ClearkeyKeySystemConfiguration;\n\n /**\n * The configuration of the AES key system.\n */\n aes128?: AES128KeySystemConfiguration;\n\n /**\n * An object of key/value pairs which can be used to pass in specific parameters related to a source into a\n * {@link ContentProtectionIntegration}.\n */\n integrationParameters?: { [parameterName: string]: any };\n\n /**\n * An ordered list of URNs of key systems as specified by https://dashif.org/identifiers/content_protection/, or one of the following identifiers:\n *\n * `\"widevine\"` alias for `\"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed\"`\n * `\"fairplay\"` alias for `\"urn:uuid:94ce86fb-07bb-4b43-adb8-93d2fa968ca2\"`\n * `\"playready\"` alias for `\"urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95\"`\n *\n * The first key system in this list which is supported on the given platform will be used for playback.\n *\n * Default value is ['widevine', 'playready', 'fairplay'].\n */\n preferredKeySystems?: Array<KeySystemId | string>;\n}\n\n/**\n * The id of a key system. Possible values are 'widevine', 'fairplay' and 'playready'.\n *\n * @public\n */\nexport type KeySystemId = 'widevine' | 'fairplay' | 'playready';\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './DRMConfiguration';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './DRMConfiguration';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["HlsPlaybackConfiguration.ts"],"sourcesContent":["/**\n * The strategy for aligning HLS discontinuities, represented by a value from the following list:\n * <br/> - `'playlist'`: The first segment after a discontinuity is aligned with the segment's start time according to the HLS playlist,\n * i.e. the sum of the `#EXTINF` durations preceding the segment.\n * This ensures that the media time is synchronized with the playlist time, allowing for frame-accurate seeking across\n * discontinuities. However, if the `#EXTINF` durations from the playlist do not closely match the actual durations\n * from the media segments, then this might lead to overlap or gaps at a discontinuity, which can result in glitches or skips\n * during playback.\n * <br/> - `'media'`: The first segment after a discontinuity is aligned with the last media frame of the previous discontinuity.\n * This ensures that there is no overlap or gap at a discontinuity, resulting in smooth playback.\n * However, this may lead to drift between the playlist time and the actual media time, which can result in less accurate seeking.\n * <br/> - `'auto'`: The player aligns discontinuities using the `'playlist'` strategy for VOD and event streams,\n * and using the `'media'` strategy for live and DVR streams.\n * This is the default.\n *\n * @remarks\n * <br/> - See {@link HlsPlaybackConfiguration.discontinuityAlignment}.\n *\n * @public\n */\nexport type HlsDiscontinuityAlignment = 'auto' | 'playlist' | 'media';\n\n/**\n * Represents a configuration for controlling playback of an MPEG-DASH stream.\n *\n * @remarks\n * <br/> - Available since v2.82.0.\n *\n * @public\n */\nexport interface HlsPlaybackConfiguration {\n /**\n * The strategy for aligning HLS discontinuities.\n *\n * @defaultValue `'auto'`\n */\n discontinuityAlignment?: HlsDiscontinuityAlignment;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './HlsPlaybackConfiguration';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './HlsPlaybackConfiguration';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["TimeRange.ts"],"sourcesContent":["export interface TimeRange {\n readonly start: number;\n\n readonly end: number;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './TimeRange';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './TimeRange';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["MediaTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { Quality } from './Quality';\n\nexport type MediaTrackKind = 'main' | 'alternative';\n\n/**\n * Represents a media track (audio or video) of a media resource.\n *\n * @public\n */\nexport interface MediaTrack extends Track {\n /**\n * The identifier of the media track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n // Note: This identifier is a randomly generated string.\n readonly id: string;\n\n /**\n * A unique identifier of the media track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n * <br/> - This identifier is a randomly generated number.\n */\n readonly uid: number;\n\n /**\n * The kind of the media track, represented by a value from the following list:\n * <br/> - `'main'`: The track is the default track for playback\n * <br/> - `'alternative'`: The track is not the default track for playback\n */\n readonly kind: MediaTrackKind;\n\n /**\n * The label of the media track.\n */\n label: string;\n\n /**\n * The language of the media track.\n */\n readonly language: string;\n\n /**\n * The uid of the active quality of the media track, i.e. the quality that is currently being played.\n */\n readonly activeQuality: number | undefined;\n\n /**\n * The qualities of the media track.\n */\n readonly qualities: Quality[];\n\n /**\n * One or more desired uids of qualities of the media track.\n *\n * @remarks\n * <br/> - If desired qualities are present, the Adaptive Bitrate mechanism of the player will limit itself to these qualities.\n * <br/> - If one desired quality is present, the Adaptive Bitrate mechanism of the player will be disabled and the desired quality will be played back.\n */\n targetQuality: number | number[] | undefined;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Quality.ts"],"sourcesContent":["/**\n * Represents a quality of a media track.\n *\n * @public\n */\nexport interface Quality {\n /**\n * The average bandwidth of the quality.\n */\n readonly averageBandwidth?: number;\n\n /**\n * The required bandwidth for the quality.\n */\n readonly bandwidth: number;\n\n /**\n * The codecs of the quality.\n *\n * @remarks\n * <br/> - These are represented as a string containing the codecs as defined by the manifest.\n */\n readonly codecs: string;\n\n /**\n * The identifier for this quality. This identifier is tied to the stream's internal representation. It may be empty. For a unique id, use {@link Quality.uid}.\n */\n readonly id: string;\n\n /**\n * The unique identifier for this quality.\n */\n readonly uid: number;\n\n /**\n * The name of the quality.\n */\n readonly name: string;\n\n /**\n * The label of the quality.\n */\n label: string;\n\n /**\n * Whether the quality is available.\n *\n * @remarks\n * <br/> - A quality can be unavailable due to a DRM restriction (e.g. HDCP).\n */\n readonly available: boolean;\n}\n\n/**\n * Represents a quality of a video track.\n *\n * @public\n */\nexport interface VideoQuality extends Quality {\n /**\n * The video height of the video quality, in pixels.\n */\n readonly height: number;\n\n /**\n * The video width of the video quality, in pixels.\n */\n readonly width: number;\n\n /**\n * The framerate of the video quality.\n */\n readonly frameRate: number;\n\n /**\n * The timestamp of the first frame of the video quality, in seconds.\n */\n readonly firstFrame: number;\n}\n\n/**\n * Represents a quality of an audio track.\n *\n * @public\n */\nexport interface AudioQuality extends Quality {\n /**\n * The sampling rate of the audio quality.\n */\n readonly audioSamplingRate: number | [number, number];\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["TextTrack.ts"],"names":["filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrack","textTrackList","t","uid","removeTextTrack","addTextTrack","hasTextTrackCue","cue","cues","c","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid"],"mappings":";;;;;;;;;;;;;;;;AAgFA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CAAgCC,UAAhC,EAA8F;AACnG,SAAOA,UAAU,IAAIA,UAAU,CAACC,MAAX,CAAmBC,SAAD,IAAeA,SAAS,CAACC,IAAV,KAAmB,WAAnB,IAAkCD,SAAS,CAACC,IAAV,KAAmB,UAAtF,CAArB;AACD;AAED;AACA;AACA;;;AACO,SAASC,qBAAT,CAA+BJ,UAA/B,EAA2F;AAChG,SAAOA,UAAU,IAAIA,UAAU,CAACK,IAAX,CAAgBC,gBAAhB,CAArB;AACD;AAED;AACA;AACA;;;AACO,SAASA,gBAAT,CAA0BJ,SAA1B,EAAqE;AAC1E,SAAO,CAAC,CAACA,SAAF,KAAgBA,SAAS,CAACC,IAAV,KAAmB,YAAnB,IAAoCD,SAAS,CAACC,IAAV,KAAmB,UAAnB,IAAiCD,SAAS,CAACK,KAAV,KAAoB,YAAzG,CAAP;AACD;;AAEM,SAASC,YAAT,CAAsBC,aAAtB,EAAkDP,SAAlD,EAAiF;AACtF,SAAO,CAAC,EAAEO,aAAa,IAAIP,SAAjB,IAA8BO,aAAa,CAACJ,IAAd,CAAoBK,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUT,SAAS,CAACS,GAA9C,CAAhC,CAAR;AACD;;AAEM,SAASC,eAAT,CAAyBH,aAAzB,EAAqDP,SAArD,EAAwF;AAC7F,SAAOO,aAAa,IAAIP,SAAjB,GAA6BO,aAAa,CAACR,MAAd,CAAsBS,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUT,SAAS,CAACS,GAAhD,CAA7B,GAAoFF,aAA3F;AACD;;AAEM,SAASI,YAAT,CAAsBJ,aAAtB,EAAkDP,SAAlD,EAAqF;AAC1F,SAAOO,aAAa,IAAIP,SAAjB,IAA8B,CAACM,YAAY,CAACC,aAAD,EAAgBP,SAAhB,CAA3C,GAAwE,CAAC,GAAGO,aAAJ,EAAmBP,SAAnB,CAAxE,GAAwGO,aAA/G;AACD;;AAEM,SAASK,eAAT,CAAyBZ,SAAzB,EAA+Ca,GAA/C,EAA2E;AAChF,SAAO,CAAC,EAAEb,SAAS,CAACc,IAAV,IAAkBD,GAAlB,IAAyBb,SAAS,CAACc,IAAV,CAAeX,IAAf,CAAqBY,CAAD,IAAOF,GAAG,CAACJ,GAAJ,KAAYM,CAAC,CAACN,GAAzC,CAA3B,CAAR;AACD;;AAEM,SAASO,kBAAT,CAA4BhB,SAA5B,EAAkDa,GAAlD,EAAqE;AAC1E,MAAIb,SAAS,IAAIA,SAAS,CAACc,IAAvB,IAA+BD,GAA/B,IAAsC,CAACD,eAAe,CAACZ,SAAD,EAAYa,GAAZ,CAA1D,EAA4E;AAC1Eb,IAAAA,SAAS,CAACc,IAAV,GAAiBd,SAAS,CAACc,IAAV,CAAef,MAAf,CAAuBgB,CAAD,IAAOA,CAAC,CAACN,GAAF,KAAUI,GAAG,CAACJ,GAA3C,CAAjB;AACD;AACF;;AAEM,SAASQ,eAAT,CAAyBjB,SAAzB,EAA+Ca,GAA/C,EAAkE;AACvE,MAAIb,SAAS,IAAIA,SAAS,CAACc,IAAvB,IAA+BD,GAA/B,IAAsC,CAACD,eAAe,CAACZ,SAAD,EAAYa,GAAZ,CAA1D,EAA4E;AAC1Eb,IAAAA,SAAS,CAACc,IAAV,CAAeI,IAAf,CAAoBL,GAApB;AACD;AACF;;AAEM,SAASM,kBAAT,CAA4BrB,UAA5B,EAAqDW,GAArD,EAAyF;AAC9F,SAAOX,UAAU,CAACK,IAAX,CAAiBK,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUA,GAAjC,CAAP;AACD","sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport type TextTrackType = 'srt' | 'ttml' | 'webvtt' | 'cea608' | '';\n\nexport type TextTrackKind = 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata' | 'thumbnails';\n\nexport type TextTrackMode = 'disabled' | 'showing';\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): boolean {\n return !!(textTrackList && textTrack && textTrackList.find((t) => t.uid === textTrack.uid));\n}\n\nexport function removeTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): TextTrack[] {\n return textTrackList && textTrack ? textTrackList.filter((t) => t.uid !== textTrack.uid) : textTrackList;\n}\n\nexport function addTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): TextTrack[] {\n return textTrackList && textTrack && !hasTextTrack(textTrackList, textTrack) ? [...textTrackList, textTrack] : textTrackList;\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack: TextTrack, cue: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack: TextTrack, cue: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"]}
1
+ {"version":3,"names":["filterRenderableTracks","textTracks","filter","textTrack","kind","filterThumbnailTracks","find","isThumbnailTrack","label","hasTextTrack","textTrackList","t","uid","removeTextTrack","addTextTrack","hasTextTrackCue","cue","cues","c","removeTextTrackCue","addTextTrackCue","push","findTextTrackByUid"],"sources":["TextTrack.ts"],"sourcesContent":["import type { Track } from './Track';\nimport type { TextTrackCue } from './TextTrackCue';\n\nexport type TextTrackType = 'srt' | 'ttml' | 'webvtt' | 'cea608' | '';\n\nexport type TextTrackKind = 'subtitles' | 'captions' | 'descriptions' | 'chapters' | 'metadata' | 'thumbnails';\n\nexport type TextTrackMode = 'disabled' | 'showing';\n\nexport interface TextTrack extends Track {\n /**\n * The kind of the text track, represented by a value from the following list:\n * <br/> - `'subtitles'`: The track contains subtitles.\n * <br/> - `'captions'`: The track contains closed captions, a translation of dialogue and sound effects.\n * <br/> - `'descriptions'`: The track contains descriptions, a textual description of the video.\n * <br/> - `'chapters'`: The track contains chapter titles.\n * <br/> - `'metadata'`: The track contains metadata. This track will not serve display purposes.\n */\n readonly kind: TextTrackKind;\n\n /**\n * The label of the text track.\n */\n label: string;\n\n /**\n * The language of the text track.\n */\n readonly language: string;\n\n /**\n * The identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the text track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n */\n readonly uid: number;\n\n /**\n * The mode of the text track, represented by a value from the following list:\n * <br/> - `'disabled'`: The track is disabled.\n * <br/> - `'showing'`: The track is showing.\n */\n mode: TextTrackMode;\n\n /**\n * The content type of the text track.\n */\n readonly type: TextTrackType;\n\n /**\n * The list of cues of the track.\n *\n * @remarks\n * <br/> - If the {@link TextTrack.mode} is `'disabled'`, this property is `null`.\n */\n cues: TextTrackCue[] | null;\n\n /**\n * The source of the text track.\n */\n readonly src: string;\n\n /**\n * Indicates whether the track contains Forced Narrative cues.\n * This may only be true for subtitle tracks where\n * <br/> - For DASH: the corresponding AdaptationSet contains a child Role with its value attribute equal to `'forced_subtitle'`\n * <br/> - For HLS: the corresponding #EXT-X-MEDIA tag contains the attributes TYPE=SUBTITLES and FORCED=YES (not supported yet)\n */\n readonly forced: boolean;\n}\n\n/**\n * Retain renderable tracks.\n * https://html.spec.whatwg.org/multipage/embedded-content.html#text-track-showing\n */\nexport function filterRenderableTracks(textTracks: TextTrack[] | undefined): TextTrack[] | undefined {\n return textTracks && textTracks.filter((textTrack) => textTrack.kind === 'subtitles' || textTrack.kind === 'captions');\n}\n\n/**\n * Retain first thumbnail track encountered in the textTracks list.\n */\nexport function filterThumbnailTracks(textTracks: TextTrack[] | undefined): TextTrack | undefined {\n return textTracks && textTracks.find(isThumbnailTrack);\n}\n\n/**\n * Query whether a track is a valid thumbnail track.\n */\nexport function isThumbnailTrack(textTrack: TextTrack | undefined): boolean {\n return !!textTrack && (textTrack.kind === 'thumbnails' || (textTrack.kind === 'metadata' && textTrack.label === 'thumbnails'));\n}\n\nexport function hasTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): boolean {\n return !!(textTrackList && textTrack && textTrackList.find((t) => t.uid === textTrack.uid));\n}\n\nexport function removeTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): TextTrack[] {\n return textTrackList && textTrack ? textTrackList.filter((t) => t.uid !== textTrack.uid) : textTrackList;\n}\n\nexport function addTextTrack(textTrackList: TextTrack[], textTrack: TextTrack): TextTrack[] {\n return textTrackList && textTrack && !hasTextTrack(textTrackList, textTrack) ? [...textTrackList, textTrack] : textTrackList;\n}\n\nexport function hasTextTrackCue(textTrack: TextTrack, cue: TextTrackCue): boolean {\n return !!(textTrack.cues && cue && textTrack.cues.find((c) => cue.uid === c.uid));\n}\n\nexport function removeTextTrackCue(textTrack: TextTrack, cue: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues = textTrack.cues.filter((c) => c.uid !== cue.uid);\n }\n}\n\nexport function addTextTrackCue(textTrack: TextTrack, cue: TextTrackCue) {\n if (textTrack && textTrack.cues && cue && !hasTextTrackCue(textTrack, cue)) {\n textTrack.cues.push(cue);\n }\n}\n\nexport function findTextTrackByUid(textTracks: TextTrack[], uid: number): TextTrack | undefined {\n return textTracks.find((t) => t.uid === uid);\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgFA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CAAgCC,UAAhC,EAA8F;EACnG,OAAOA,UAAU,IAAIA,UAAU,CAACC,MAAX,CAAmBC,SAAD,IAAeA,SAAS,CAACC,IAAV,KAAmB,WAAnB,IAAkCD,SAAS,CAACC,IAAV,KAAmB,UAAtF,CAArB;AACD;AAED;AACA;AACA;;;AACO,SAASC,qBAAT,CAA+BJ,UAA/B,EAA2F;EAChG,OAAOA,UAAU,IAAIA,UAAU,CAACK,IAAX,CAAgBC,gBAAhB,CAArB;AACD;AAED;AACA;AACA;;;AACO,SAASA,gBAAT,CAA0BJ,SAA1B,EAAqE;EAC1E,OAAO,CAAC,CAACA,SAAF,KAAgBA,SAAS,CAACC,IAAV,KAAmB,YAAnB,IAAoCD,SAAS,CAACC,IAAV,KAAmB,UAAnB,IAAiCD,SAAS,CAACK,KAAV,KAAoB,YAAzG,CAAP;AACD;;AAEM,SAASC,YAAT,CAAsBC,aAAtB,EAAkDP,SAAlD,EAAiF;EACtF,OAAO,CAAC,EAAEO,aAAa,IAAIP,SAAjB,IAA8BO,aAAa,CAACJ,IAAd,CAAoBK,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUT,SAAS,CAACS,GAA9C,CAAhC,CAAR;AACD;;AAEM,SAASC,eAAT,CAAyBH,aAAzB,EAAqDP,SAArD,EAAwF;EAC7F,OAAOO,aAAa,IAAIP,SAAjB,GAA6BO,aAAa,CAACR,MAAd,CAAsBS,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUT,SAAS,CAACS,GAAhD,CAA7B,GAAoFF,aAA3F;AACD;;AAEM,SAASI,YAAT,CAAsBJ,aAAtB,EAAkDP,SAAlD,EAAqF;EAC1F,OAAOO,aAAa,IAAIP,SAAjB,IAA8B,CAACM,YAAY,CAACC,aAAD,EAAgBP,SAAhB,CAA3C,GAAwE,CAAC,GAAGO,aAAJ,EAAmBP,SAAnB,CAAxE,GAAwGO,aAA/G;AACD;;AAEM,SAASK,eAAT,CAAyBZ,SAAzB,EAA+Ca,GAA/C,EAA2E;EAChF,OAAO,CAAC,EAAEb,SAAS,CAACc,IAAV,IAAkBD,GAAlB,IAAyBb,SAAS,CAACc,IAAV,CAAeX,IAAf,CAAqBY,CAAD,IAAOF,GAAG,CAACJ,GAAJ,KAAYM,CAAC,CAACN,GAAzC,CAA3B,CAAR;AACD;;AAEM,SAASO,kBAAT,CAA4BhB,SAA5B,EAAkDa,GAAlD,EAAqE;EAC1E,IAAIb,SAAS,IAAIA,SAAS,CAACc,IAAvB,IAA+BD,GAA/B,IAAsC,CAACD,eAAe,CAACZ,SAAD,EAAYa,GAAZ,CAA1D,EAA4E;IAC1Eb,SAAS,CAACc,IAAV,GAAiBd,SAAS,CAACc,IAAV,CAAef,MAAf,CAAuBgB,CAAD,IAAOA,CAAC,CAACN,GAAF,KAAUI,GAAG,CAACJ,GAA3C,CAAjB;EACD;AACF;;AAEM,SAASQ,eAAT,CAAyBjB,SAAzB,EAA+Ca,GAA/C,EAAkE;EACvE,IAAIb,SAAS,IAAIA,SAAS,CAACc,IAAvB,IAA+BD,GAA/B,IAAsC,CAACD,eAAe,CAACZ,SAAD,EAAYa,GAAZ,CAA1D,EAA4E;IAC1Eb,SAAS,CAACc,IAAV,CAAeI,IAAf,CAAoBL,GAApB;EACD;AACF;;AAEM,SAASM,kBAAT,CAA4BrB,UAA5B,EAAqDW,GAArD,EAAyF;EAC9F,OAAOX,UAAU,CAACK,IAAX,CAAiBK,CAAD,IAAOA,CAAC,CAACC,GAAF,KAAUA,GAAjC,CAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["TextTrackCue.ts"],"sourcesContent":["/**\n * Represents a cue of a text track.\n *\n * @public\n */\nexport interface TextTrackCue {\n /**\n * The identifier of the cue.\n */\n id: string;\n\n /**\n * A unique identifier of the text track cue.\n *\n * @remarks\n * <br/> - This identifier is unique across text track cues of a THEOplayer instance and can be used to distinguish between cues.\n * <br/> - This identifier is a randomly generated number.\n */\n readonly uid: number;\n\n /**\n * The playback position at which the cue becomes active, in milliseconds.\n */\n startTime: number;\n\n /**\n * The playback position at which the cue becomes inactive, in milliseconds.\n */\n endTime: number;\n\n /**\n * The content of the cue.\n *\n * @remarks\n * The content differs depending on the {@link TextTrackCue.track}'s {@link TextTrack.\"type\" | type }:\n * <br/> - `'emsg'`: Content is a Uint8Array representing the binary message data from the `emsg` box.\n * <br/> - `'eventstream'`: Content is the value of the `messageData` attribute which was specified in the manifest.\n * <br/> - `'ttml'`: Content is an intermediate TTML document’s body element. This is a view of a TTML document where all nodes in the document are active during the cue’s startTime and endTime. As a result, all begin, dur and end properties have been removed. TTML Styles, Regions and Metadata are stored in cue.styles, cue.regions, cue.metadata respectively. Combining those properties with the given content should suffice to render a TTML cue.\n * <br/> - `'webvtt'`: Content is the cue text in raw unparsed form.\n */\n content: any;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
1
+ {"version":3,"names":[],"sources":["Track.ts"],"sourcesContent":["/**\n * Represents a track of a media resource.\n *\n * @remarks\n * <br/> - A specific track type (e.g. {@link TextTrack}) will always be used.\n *\n * @public\n */\nexport interface Track {\n /**\n * The kind of the track.\n *\n * @remarks\n * <br/> - The values for this property depend on the specific type of the track.\n */\n readonly kind: string;\n\n /**\n * The label of the track.\n */\n label: string;\n\n /**\n * The identifier of the track.\n *\n * @remarks\n * <br/> - This identifier can be used to distinguish between related tracks, e.g. tracks in the same list.\n *\n * @privateRemarks\n * <br/> - This identifier is a randomly generated string.\n */\n readonly id: string;\n\n /**\n * A unique identifier of the track.\n *\n * @remarks\n * <br/> - This identifier is unique across tracks of a THEOplayer instance and can be used to distinguish between tracks.\n * <br/> - This identifier is a randomly generated number.\n */\n readonly uid: number;\n\n /**\n * The language of the track.\n */\n readonly language: string;\n}\n"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["barrel.ts"],"names":[],"mappings":";;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","sourcesContent":["export * from './MediaTrack';\nexport * from './Quality';\nexport * from './TextTrack';\nexport * from './TextTrackCue';\nexport * from './Track';\n"]}
1
+ {"version":3,"names":[],"sources":["barrel.ts"],"sourcesContent":["export * from './MediaTrack';\nexport * from './Quality';\nexport * from './TextTrack';\nexport * from './TextTrackCue';\nexport * from './Track';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AACA","sourcesContent":["export * from './api/barrel';\nexport { THEOplayerView } from './internal/THEOplayerView';\n"]}
1
+ {"version":3,"names":[],"sources":["index.tsx"],"sourcesContent":["export * from './api/barrel';\nexport { THEOplayerView } from './internal/THEOplayerView';\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA"}
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
17
 
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
20
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
21
21
 
22
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
 
@@ -180,6 +180,21 @@ class THEOplayerView extends _react.PureComponent {
180
180
  this.state = THEOplayerView.initialState;
181
181
  }
182
182
 
183
+ componentWillUnmount() {
184
+ if (_reactNative.Platform.OS === 'ios') {
185
+ // on iOS, we trigger an explicit 'destroy' to clean up the underlying THEOplayer
186
+ this.destroyTheoPlayer();
187
+ }
188
+ }
189
+
190
+ destroyTheoPlayer() {
191
+ const node = (0, _reactNative.findNodeHandle)(this._root.current);
192
+ const command = _reactNative.UIManager['THEOplayerRCTView'].Commands.destroy;
193
+ const params = [];
194
+
195
+ _reactNative.UIManager.dispatchViewManagerCommand(node, command, params);
196
+ }
197
+
183
198
  seek(time) {
184
199
  if (isNaN(time)) {
185
200
  throw new Error('Specified time is not a number');