expo-video 2.1.9 → 2.2.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 (64) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/video/VideoModule.kt +21 -1
  4. package/android/src/main/java/expo/modules/video/VideoView.kt +7 -4
  5. package/android/src/main/java/expo/modules/video/player/FirstFrameEventGenerator.kt +3 -2
  6. package/android/src/main/java/expo/modules/video/player/PlayerEvent.kt +20 -2
  7. package/android/src/main/java/expo/modules/video/player/VideoPlayer.kt +16 -1
  8. package/android/src/main/java/expo/modules/video/player/VideoPlayerAudioTracks.kt +125 -0
  9. package/android/src/main/java/expo/modules/video/records/Tracks.kt +21 -0
  10. package/android/src/main/java/expo/modules/video/records/VideoEventPayloads.kt +12 -1
  11. package/build/VideoPlayer.types.d.ts +30 -0
  12. package/build/VideoPlayer.types.d.ts.map +1 -1
  13. package/build/VideoPlayer.types.js.map +1 -1
  14. package/build/VideoPlayer.web.d.ts +3 -1
  15. package/build/VideoPlayer.web.d.ts.map +1 -1
  16. package/build/VideoPlayer.web.js +2 -0
  17. package/build/VideoPlayer.web.js.map +1 -1
  18. package/build/VideoPlayerEvents.types.d.ts +34 -1
  19. package/build/VideoPlayerEvents.types.d.ts.map +1 -1
  20. package/build/VideoPlayerEvents.types.js.map +1 -1
  21. package/build/VideoView.types.d.ts +1 -1
  22. package/build/VideoView.types.d.ts.map +1 -1
  23. package/build/VideoView.types.js.map +1 -1
  24. package/build/index.d.ts +1 -1
  25. package/build/index.d.ts.map +1 -1
  26. package/build/index.js.map +1 -1
  27. package/expo-module.config.json +7 -1
  28. package/ios/Records/Tracks.swift +13 -0
  29. package/ios/Records/VideoEventPayloads.swift +11 -0
  30. package/ios/VideoModule.swift +11 -0
  31. package/ios/VideoPlayer.swift +20 -1
  32. package/ios/VideoPlayerAudioTracks.swift +72 -0
  33. package/ios/VideoPlayerObserver.swift +15 -0
  34. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0-sources.jar +0 -0
  35. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0-sources.jar.md5 +1 -0
  36. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0-sources.jar.sha1 +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0-sources.jar.sha256 +1 -0
  38. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0-sources.jar.sha512 +1 -0
  39. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.aar +0 -0
  40. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.aar.md5 +1 -0
  41. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.aar.sha1 +1 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.aar.sha256 +1 -0
  43. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.aar.sha512 +1 -0
  44. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.module +147 -0
  45. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.module.md5 +1 -0
  46. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.module.sha1 +1 -0
  47. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.module.sha256 +1 -0
  48. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.module.sha512 +1 -0
  49. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.pom +88 -0
  50. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.pom.md5 +1 -0
  51. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.pom.sha1 +1 -0
  52. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.pom.sha256 +1 -0
  53. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.2.0/expo.modules.video-2.2.0.pom.sha512 +1 -0
  54. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml +13 -0
  55. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.md5 +1 -0
  56. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha1 +1 -0
  57. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha256 +1 -0
  58. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha512 +1 -0
  59. package/package.json +2 -2
  60. package/src/VideoPlayer.types.ts +35 -0
  61. package/src/VideoPlayer.web.tsx +3 -0
  62. package/src/VideoPlayerEvents.types.ts +40 -0
  63. package/src/VideoView.types.ts +2 -1
  64. package/src/index.ts +1 -0
@@ -0,0 +1,147 @@
1
+ {
2
+ "formatVersion": "1.1",
3
+ "component": {
4
+ "group": "host.exp.exponent",
5
+ "module": "expo.modules.video",
6
+ "version": "2.2.0",
7
+ "attributes": {
8
+ "org.gradle.status": "release"
9
+ }
10
+ },
11
+ "createdBy": {
12
+ "gradle": {
13
+ "version": "8.13"
14
+ }
15
+ },
16
+ "variants": [
17
+ {
18
+ "name": "releaseVariantReleaseApiPublication",
19
+ "attributes": {
20
+ "org.gradle.category": "library",
21
+ "org.gradle.dependency.bundling": "external",
22
+ "org.gradle.libraryelements": "aar",
23
+ "org.gradle.usage": "java-api"
24
+ },
25
+ "files": [
26
+ {
27
+ "name": "expo.modules.video-2.2.0.aar",
28
+ "url": "expo.modules.video-2.2.0.aar",
29
+ "size": 444322,
30
+ "sha512": "a1501f7e947680eba85a049cf0520518bca4feca64832fbdc41383cb2c483f6253ecf8d429ad936966fcce1b0494175035399894dbce9c50f4765bd099edebf1",
31
+ "sha256": "0022fab08b59c4346e67a4bf573af546f4f0e7eb322aee1115335e035318fa2c",
32
+ "sha1": "06203802abf1c39df7bef9bddb6cf7dda03e6300",
33
+ "md5": "b87e04623a8bc68b39b0d628a278460d"
34
+ }
35
+ ]
36
+ },
37
+ {
38
+ "name": "releaseVariantReleaseRuntimePublication",
39
+ "attributes": {
40
+ "org.gradle.category": "library",
41
+ "org.gradle.dependency.bundling": "external",
42
+ "org.gradle.libraryelements": "aar",
43
+ "org.gradle.usage": "java-runtime"
44
+ },
45
+ "dependencies": [
46
+ {
47
+ "group": "org.jetbrains.kotlin",
48
+ "module": "kotlin-stdlib-jdk7",
49
+ "version": {
50
+ "requires": "2.0.21"
51
+ }
52
+ },
53
+ {
54
+ "group": "com.facebook.react",
55
+ "module": "react-android"
56
+ },
57
+ {
58
+ "group": "androidx.media3",
59
+ "module": "media3-session",
60
+ "version": {
61
+ "requires": "1.4.0"
62
+ }
63
+ },
64
+ {
65
+ "group": "androidx.media3",
66
+ "module": "media3-exoplayer",
67
+ "version": {
68
+ "requires": "1.4.0"
69
+ }
70
+ },
71
+ {
72
+ "group": "androidx.media3",
73
+ "module": "media3-exoplayer-dash",
74
+ "version": {
75
+ "requires": "1.4.0"
76
+ }
77
+ },
78
+ {
79
+ "group": "androidx.media3",
80
+ "module": "media3-exoplayer-hls",
81
+ "version": {
82
+ "requires": "1.4.0"
83
+ }
84
+ },
85
+ {
86
+ "group": "androidx.media3",
87
+ "module": "media3-ui",
88
+ "version": {
89
+ "requires": "1.4.0"
90
+ }
91
+ },
92
+ {
93
+ "group": "androidx.media3",
94
+ "module": "media3-datasource-okhttp",
95
+ "version": {
96
+ "requires": "1.4.0"
97
+ }
98
+ },
99
+ {
100
+ "group": "androidx.fragment",
101
+ "module": "fragment",
102
+ "version": {
103
+ "requires": "1.6.2"
104
+ }
105
+ },
106
+ {
107
+ "group": "androidx.fragment",
108
+ "module": "fragment-ktx",
109
+ "version": {
110
+ "requires": "1.6.2"
111
+ }
112
+ }
113
+ ],
114
+ "files": [
115
+ {
116
+ "name": "expo.modules.video-2.2.0.aar",
117
+ "url": "expo.modules.video-2.2.0.aar",
118
+ "size": 444322,
119
+ "sha512": "a1501f7e947680eba85a049cf0520518bca4feca64832fbdc41383cb2c483f6253ecf8d429ad936966fcce1b0494175035399894dbce9c50f4765bd099edebf1",
120
+ "sha256": "0022fab08b59c4346e67a4bf573af546f4f0e7eb322aee1115335e035318fa2c",
121
+ "sha1": "06203802abf1c39df7bef9bddb6cf7dda03e6300",
122
+ "md5": "b87e04623a8bc68b39b0d628a278460d"
123
+ }
124
+ ]
125
+ },
126
+ {
127
+ "name": "releaseVariantReleaseSourcePublication",
128
+ "attributes": {
129
+ "org.gradle.category": "documentation",
130
+ "org.gradle.dependency.bundling": "external",
131
+ "org.gradle.docstype": "sources",
132
+ "org.gradle.usage": "java-runtime"
133
+ },
134
+ "files": [
135
+ {
136
+ "name": "expo.modules.video-2.2.0-sources.jar",
137
+ "url": "expo.modules.video-2.2.0-sources.jar",
138
+ "size": 52499,
139
+ "sha512": "c7c374ab88183e831ed5a80a5e7a6f9ef2d29d4157c7b9496e30a9f87b14c4952b1e867b29f8feedbab21badccdf1b751f3a20367d1970a5e814311d96618f0e",
140
+ "sha256": "ff54e2221752092ebdece914b77e4504b2864fc94504c8a1887ea67a2afa5ea0",
141
+ "sha1": "f26b20423aa775f88468456856f576c24bc8149b",
142
+ "md5": "6e1f79fc8674bec45f35f95a4f8933f3"
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ }
@@ -0,0 +1 @@
1
+ dc4736ff81e3bdb761a88697e35d0a7612f679f84daab0b6f4147510254413f2
@@ -0,0 +1 @@
1
+ 8e05e96b0ea1f0b9c965ea20642b5654d498a8be3dadfe985675d0b0dbccb06b35dae83f2a0dde27019b678f7c73a8b1cb1dab61503a658150f6a4f55560348b
@@ -0,0 +1,88 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
3
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4
+ <!-- This module was also published with a richer model, Gradle metadata, -->
5
+ <!-- which should be used instead. Do not delete the following line which -->
6
+ <!-- is to indicate to Gradle or any Gradle module metadata file consumer -->
7
+ <!-- that they should prefer consuming it instead. -->
8
+ <!-- do_not_remove: published-with-gradle-metadata -->
9
+ <modelVersion>4.0.0</modelVersion>
10
+ <groupId>host.exp.exponent</groupId>
11
+ <artifactId>expo.modules.video</artifactId>
12
+ <version>2.2.0</version>
13
+ <packaging>aar</packaging>
14
+ <name>expo.modules.video</name>
15
+ <url>https://github.com/expo/expo</url>
16
+ <licenses>
17
+ <license>
18
+ <name>MIT License</name>
19
+ <url>https://github.com/expo/expo/blob/main/LICENSE</url>
20
+ </license>
21
+ </licenses>
22
+ <scm>
23
+ <connection>https://github.com/expo/expo.git</connection>
24
+ <developerConnection>https://github.com/expo/expo.git</developerConnection>
25
+ <url>https://github.com/expo/expo</url>
26
+ </scm>
27
+ <dependencies>
28
+ <dependency>
29
+ <groupId>org.jetbrains.kotlin</groupId>
30
+ <artifactId>kotlin-stdlib-jdk7</artifactId>
31
+ <version>2.0.21</version>
32
+ <scope>runtime</scope>
33
+ </dependency>
34
+ <dependency>
35
+ <groupId>com.facebook.react</groupId>
36
+ <artifactId>react-android</artifactId>
37
+ <scope>runtime</scope>
38
+ </dependency>
39
+ <dependency>
40
+ <groupId>androidx.media3</groupId>
41
+ <artifactId>media3-session</artifactId>
42
+ <version>1.4.0</version>
43
+ <scope>runtime</scope>
44
+ </dependency>
45
+ <dependency>
46
+ <groupId>androidx.media3</groupId>
47
+ <artifactId>media3-exoplayer</artifactId>
48
+ <version>1.4.0</version>
49
+ <scope>runtime</scope>
50
+ </dependency>
51
+ <dependency>
52
+ <groupId>androidx.media3</groupId>
53
+ <artifactId>media3-exoplayer-dash</artifactId>
54
+ <version>1.4.0</version>
55
+ <scope>runtime</scope>
56
+ </dependency>
57
+ <dependency>
58
+ <groupId>androidx.media3</groupId>
59
+ <artifactId>media3-exoplayer-hls</artifactId>
60
+ <version>1.4.0</version>
61
+ <scope>runtime</scope>
62
+ </dependency>
63
+ <dependency>
64
+ <groupId>androidx.media3</groupId>
65
+ <artifactId>media3-ui</artifactId>
66
+ <version>1.4.0</version>
67
+ <scope>runtime</scope>
68
+ </dependency>
69
+ <dependency>
70
+ <groupId>androidx.media3</groupId>
71
+ <artifactId>media3-datasource-okhttp</artifactId>
72
+ <version>1.4.0</version>
73
+ <scope>runtime</scope>
74
+ </dependency>
75
+ <dependency>
76
+ <groupId>androidx.fragment</groupId>
77
+ <artifactId>fragment</artifactId>
78
+ <version>1.6.2</version>
79
+ <scope>runtime</scope>
80
+ </dependency>
81
+ <dependency>
82
+ <groupId>androidx.fragment</groupId>
83
+ <artifactId>fragment-ktx</artifactId>
84
+ <version>1.6.2</version>
85
+ <scope>runtime</scope>
86
+ </dependency>
87
+ </dependencies>
88
+ </project>
@@ -0,0 +1 @@
1
+ 49d5a63d0c4fbfb5dc9f9d45ea1512c281f2a5a2
@@ -0,0 +1 @@
1
+ af02050cf8898237faf34bc624abff592a33c4a86a34352ea485a4c3d00361f3
@@ -0,0 +1 @@
1
+ 6354cc8b4f6fc7cdb027d5c6302584ed0d5f8c79c61b77921dd6ffe0f751a1465eae20c7ae3f505a19070ea5f57edcbaff7a6af19934124f740461e734dc0f96
@@ -0,0 +1,13 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <metadata>
3
+ <groupId>host.exp.exponent</groupId>
4
+ <artifactId>expo.modules.video</artifactId>
5
+ <versioning>
6
+ <latest>2.2.0</latest>
7
+ <release>2.2.0</release>
8
+ <versions>
9
+ <version>2.2.0</version>
10
+ </versions>
11
+ <lastUpdated>20250604230414</lastUpdated>
12
+ </versioning>
13
+ </metadata>
@@ -0,0 +1 @@
1
+ d7576712c099005e0070a39cce656ca6
@@ -0,0 +1 @@
1
+ 52a901eebefa6fac0c034b76185f5386b9113588
@@ -0,0 +1 @@
1
+ 28ab1754acdffea060d818f3e54d1bfc0823de6c803276cf828c4371524eb793
@@ -0,0 +1 @@
1
+ 1eb28fa579897d17888ae6f4f6dc0f996daf6c967f6dba0e239386c00c42e399b4dce3b2a8274364679e4c562ccd3b619c4e3271b0a4ed695c29b5097711c710
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-video",
3
3
  "title": "Expo Video",
4
- "version": "2.1.9",
4
+ "version": "2.2.0",
5
5
  "description": "A cross-platform, performant video component for React Native and Expo with Web support",
6
6
  "main": "build/index.js",
7
7
  "types": "build/index.d.ts",
@@ -38,5 +38,5 @@
38
38
  "react": "*",
39
39
  "react-native": "*"
40
40
  },
41
- "gitHead": "49c9d53cf0a9fc8179d1c8f5268beadd141f70ca"
41
+ "gitHead": "7638c800b57fe78f57cc7f129022f58e84a523c5"
42
42
  }
@@ -165,6 +165,23 @@ export declare class VideoPlayer extends SharedObject<VideoPlayerEvents> {
165
165
  */
166
166
  subtitleTrack: SubtitleTrack | null;
167
167
 
168
+ /**
169
+ * Specifies the audio track currently played by the player. `null` when no audio is played.
170
+ *
171
+ * @default null
172
+ * @platform android
173
+ * @platform ios
174
+ */
175
+ audioTrack: AudioTrack | null;
176
+
177
+ /**
178
+ * An array of audio tracks available for the current video.
179
+ *
180
+ * @platform android
181
+ * @platform ios
182
+ */
183
+ readonly availableAudioTracks: AudioTrack[];
184
+
168
185
  /**
169
186
  * An array of subtitle tracks available for the current video.
170
187
  *
@@ -576,3 +593,21 @@ export type VideoSize = {
576
593
  */
577
594
  height: number;
578
595
  };
596
+
597
+ export type AudioTrack = {
598
+ /**
599
+ * A string used by expo-video to identify the audio track.
600
+ * @platform android
601
+ */
602
+ id: string;
603
+
604
+ /**
605
+ * Language of the audio track. For example, 'en', 'pl', 'de'.
606
+ */
607
+ language: string;
608
+
609
+ /**
610
+ * Label of the audio track in the language of the device.
611
+ */
612
+ label: string;
613
+ };
@@ -9,6 +9,7 @@ import type {
9
9
  SubtitleTrack,
10
10
  AudioMixingMode,
11
11
  VideoTrack,
12
+ AudioTrack,
12
13
  } from './VideoPlayer.types';
13
14
  import type { VideoPlayerEvents } from './VideoPlayerEvents.types';
14
15
  import { VideoThumbnail } from './VideoThumbnail';
@@ -80,6 +81,8 @@ export default class VideoPlayerWeb
80
81
  bufferOptions: BufferOptions = {} as BufferOptions; // Not supported on web. Dummy to match the interface.
81
82
  subtitleTrack: SubtitleTrack | null = null; // Embedded subtitles are not supported by the html web player. Dummy to match the interface.
82
83
  availableSubtitleTracks: SubtitleTrack[] = []; // Embedded subtitles are not supported by the html web player. Dummy to match the interface.
84
+ audioTrack: AudioTrack | null = null; // Not supported on web. Dummy to match the interface.
85
+ availableAudioTracks: AudioTrack[] = []; // Not supported on web. Dummy to match the interface.
83
86
  videoTrack: VideoTrack | null = null; // Not supported on web. Dummy to match the interface.
84
87
  availableVideoTracks: VideoTrack[] = []; // Not supported on web. Dummy to match the interface.
85
88
 
@@ -4,6 +4,7 @@ import {
4
4
  VideoPlayerStatus,
5
5
  VideoSource,
6
6
  VideoTrack,
7
+ AudioTrack,
7
8
  } from './VideoPlayer.types';
8
9
 
9
10
  /**
@@ -60,6 +61,16 @@ export type VideoPlayerEvents = {
60
61
  */
61
62
  subtitleTrackChange(payload: SubtitleTrackChangeEventPayload): void;
62
63
 
64
+ /**
65
+ * Handler for an event emitted when the available audio tracks change.
66
+ */
67
+ availableAudioTracksChange(payload: AvailableAudioTracksChangeEventPayload): void;
68
+
69
+ /**
70
+ * Handler for an event emitted when the current audio track changes.
71
+ */
72
+ audioTrackChange(payload: AudioTrackChangeEventPayload): void;
73
+
63
74
  /**
64
75
  * Handler for an event emitted when the current video track changes.
65
76
  */
@@ -270,4 +281,33 @@ export type SourceLoadEventPayload = {
270
281
  * Subtitle tracks available for the loaded video source.
271
282
  */
272
283
  availableSubtitleTracks: SubtitleTrack[];
284
+
285
+ /**
286
+ * Audio tracks available for the loaded video source.
287
+ */
288
+ availableAudioTracks: AudioTrack[];
289
+ };
290
+
291
+ type AudioTrackChangeEventPayload = {
292
+ /**
293
+ * New audio track of the player.
294
+ */
295
+ audioTrack: AudioTrack | null;
296
+
297
+ /**
298
+ * Previous audio track of the player.
299
+ */
300
+ oldAudioTrack?: AudioTrack | null;
301
+ };
302
+
303
+ type AvailableAudioTracksChangeEventPayload = {
304
+ /**
305
+ * Array of available audio tracks.
306
+ */
307
+ availableAudioTracks: AudioTrack[];
308
+
309
+ /**
310
+ * Previous array of available audio tracks.
311
+ */
312
+ oldAvailableAudioTracks?: AudioTrack[];
273
313
  };
@@ -150,9 +150,10 @@ export interface VideoViewProps extends ViewProps {
150
150
  * Setting this property to `false` makes the Android behavior the same as iOS.
151
151
  *
152
152
  * @platform android
153
- * @default true
153
+ * @default false
154
154
  */
155
155
  useExoShutter?: boolean;
156
+
156
157
  /**
157
158
  * Determines the [cross origin policy](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/crossorigin) used by the underlying native view on web.
158
159
  * If undefined, does not use CORS at all.
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ export {
25
25
  VideoThumbnailOptions,
26
26
  VideoSize,
27
27
  SubtitleTrack,
28
+ AudioTrack,
28
29
  VideoTrack,
29
30
  ContentType,
30
31
  } from './VideoPlayer.types';