expo-video 2.1.1 → 2.1.3

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 (53) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/android/build.gradle +2 -2
  3. package/android/src/main/java/expo/modules/video/VideoManager.kt +2 -2
  4. package/android/src/main/java/expo/modules/video/VideoView.kt +40 -2
  5. package/android/src/main/java/expo/modules/video/utils/EventDispatcherUtils.kt +43 -0
  6. package/build/VideoPlayer.js +2 -0
  7. package/build/VideoPlayer.js.map +1 -1
  8. package/expo-module.config.json +1 -1
  9. package/local-maven-repo/host/exp/exponent/expo.modules.video/{2.1.1/expo.modules.video-2.1.1-sources.jar → 2.1.3/expo.modules.video-2.1.3-sources.jar} +0 -0
  10. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3-sources.jar.md5 +1 -0
  11. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3-sources.jar.sha1 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3-sources.jar.sha256 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3-sources.jar.sha512 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.aar +0 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.aar.md5 +1 -0
  16. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.aar.sha1 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.aar.sha256 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.aar.sha512 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.video/{2.1.1/expo.modules.video-2.1.1.module → 2.1.3/expo.modules.video-2.1.3.module} +22 -22
  20. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.module.md5 +1 -0
  21. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.module.sha1 +1 -0
  22. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.module.sha256 +1 -0
  23. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.module.sha512 +1 -0
  24. package/local-maven-repo/host/exp/exponent/expo.modules.video/{2.1.1/expo.modules.video-2.1.1.pom → 2.1.3/expo.modules.video-2.1.3.pom} +1 -1
  25. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.pom.md5 +1 -0
  26. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.pom.sha1 +1 -0
  27. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.pom.sha256 +1 -0
  28. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.3/expo.modules.video-2.1.3.pom.sha512 +1 -0
  29. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml +4 -4
  30. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.md5 +1 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha1 +1 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha256 +1 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.video/maven-metadata.xml.sha512 +1 -1
  34. package/package.json +3 -3
  35. package/src/VideoPlayer.tsx +4 -2
  36. package/src/ts-declarations/react-native-assets.d.ts +1 -0
  37. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1-sources.jar.md5 +0 -1
  38. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1-sources.jar.sha1 +0 -1
  39. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1-sources.jar.sha256 +0 -1
  40. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1-sources.jar.sha512 +0 -1
  41. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.aar +0 -0
  42. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.aar.md5 +0 -1
  43. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.aar.sha1 +0 -1
  44. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.aar.sha256 +0 -1
  45. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.aar.sha512 +0 -1
  46. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.module.md5 +0 -1
  47. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.module.sha1 +0 -1
  48. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.module.sha256 +0 -1
  49. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.module.sha512 +0 -1
  50. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.pom.md5 +0 -1
  51. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.pom.sha1 +0 -1
  52. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.pom.sha256 +0 -1
  53. package/local-maven-repo/host/exp/exponent/expo.modules.video/2.1.1/expo.modules.video-2.1.1.pom.sha512 +0 -1
package/CHANGELOG.md CHANGED
@@ -10,6 +10,14 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 2.1.3 — 2025-04-21
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 2.1.2 — 2025-04-14
18
+
19
+ _This version does not introduce any user-facing changes._
20
+
13
21
  ## 2.1.1 — 2025-04-09
14
22
 
15
23
  _This version does not introduce any user-facing changes._
@@ -32,6 +40,7 @@ _This version does not introduce any user-facing changes._
32
40
  - [iOS] Fix the Now Playing notification disappearing after the video is paused. ([#35273](https://github.com/expo/expo/pull/35273) by [@behenate](https://github.com/behenate))
33
41
  - [iOS] Fix a race condition in setting the targets for the Now Playing controls causing the controls to sometimes not work. ([#35274](https://github.com/expo/expo/pull/35274) by [@behenate](https://github.com/behenate))
34
42
  - [iOS] Fix disabling the Now Playing controls for multiple players at the same time causing the notification to break. ([#35275](https://github.com/expo/expo/pull/35275) by [@behenate](https://github.com/behenate))
43
+ - [Android] Fix touch events not being emitted for `VideoView`. ([#35479](https://github.com/expo/expo/pull/35479) by [@behenate](https://github.com/behenate))
35
44
 
36
45
  ### 💡 Others
37
46
 
@@ -4,13 +4,13 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '2.1.1'
7
+ version = '2.1.3'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.video"
11
11
  defaultConfig {
12
12
  versionCode 1
13
- versionName '2.1.1'
13
+ versionName '2.1.3'
14
14
  }
15
15
  }
16
16
 
@@ -34,7 +34,7 @@ object VideoManager {
34
34
  }
35
35
 
36
36
  fun registerVideoView(videoView: VideoView) {
37
- videoViews[videoView.id] = videoView
37
+ videoViews[videoView.videoViewId] = videoView
38
38
  }
39
39
 
40
40
  fun getVideoView(id: String): VideoView {
@@ -42,7 +42,7 @@ object VideoManager {
42
42
  }
43
43
 
44
44
  fun unregisterVideoView(videoView: VideoView) {
45
- videoViews.remove(videoView.id)
45
+ videoViews.remove(videoView.videoViewId)
46
46
  }
47
47
 
48
48
  fun registerVideoPlayer(videoPlayer: VideoPlayer) {
@@ -7,6 +7,7 @@ import android.content.Intent
7
7
  import android.graphics.Color
8
8
  import android.os.Build
9
9
  import android.util.Rational
10
+ import android.view.MotionEvent
10
11
  import android.view.View
11
12
  import android.view.ViewGroup
12
13
  import android.widget.FrameLayout
@@ -14,6 +15,10 @@ import android.widget.ImageButton
14
15
  import androidx.fragment.app.FragmentActivity
15
16
  import androidx.media3.common.Tracks
16
17
  import androidx.media3.ui.PlayerView
18
+ import com.facebook.react.bridge.ReactContext
19
+ import com.facebook.react.uimanager.UIManagerHelper
20
+ import com.facebook.react.uimanager.events.EventDispatcher
21
+ import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper
17
22
  import expo.modules.kotlin.AppContext
18
23
  import expo.modules.kotlin.viewevent.EventDispatcher
19
24
  import expo.modules.kotlin.views.ExpoView
@@ -24,12 +29,13 @@ import expo.modules.video.player.VideoPlayerListener
24
29
  import expo.modules.video.utils.applyAutoEnterPiP
25
30
  import expo.modules.video.utils.applyRectHint
26
31
  import expo.modules.video.utils.calculateRectHint
32
+ import expo.modules.video.utils.dispatchMotionEvent
27
33
  import java.util.UUID
28
34
 
29
35
  // https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide#improvements_in_media3
30
36
  @androidx.annotation.OptIn(androidx.media3.common.util.UnstableApi::class)
31
37
  class VideoView(context: Context, appContext: AppContext) : ExpoView(context, appContext), VideoPlayerListener {
32
- val id: String = UUID.randomUUID().toString()
38
+ val videoViewId: String = UUID.randomUUID().toString()
33
39
  val playerView: PlayerView = PlayerView(context.applicationContext)
34
40
  val onPictureInPictureStart by EventDispatcher<Unit>()
35
41
  val onPictureInPictureStop by EventDispatcher<Unit>()
@@ -50,9 +56,11 @@ class VideoView(context: Context, appContext: AppContext) : ExpoView(context, ap
50
56
  private val currentActivity = appContext.throwingActivity
51
57
  private val decorView = currentActivity.window.decorView
52
58
  private val rootView = decorView.findViewById<ViewGroup>(android.R.id.content)
59
+ private val touchEventCoalescingKeyHelper = TouchEventCoalescingKeyHelper()
53
60
 
54
61
  private val rootViewChildrenOriginalVisibility: ArrayList<Int> = arrayListOf()
55
62
  private var pictureInPictureHelperTag: String? = null
63
+ private var reactNativeEventDispatcher: EventDispatcher? = null
56
64
 
57
65
  // We need to keep track of the target surface view visibility, but only apply it when `useExoShutter` is false.
58
66
  var shouldHideSurfaceView: Boolean = true
@@ -138,6 +146,8 @@ class VideoView(context: Context, appContext: AppContext) : ExpoView(context, ap
138
146
  ViewGroup.LayoutParams.MATCH_PARENT
139
147
  )
140
148
  )
149
+
150
+ reactNativeEventDispatcher = UIManagerHelper.getEventDispatcher(appContext.reactContext as ReactContext, id)
141
151
  }
142
152
 
143
153
  fun applySurfaceViewVisibility() {
@@ -150,7 +160,7 @@ class VideoView(context: Context, appContext: AppContext) : ExpoView(context, ap
150
160
 
151
161
  fun enterFullscreen() {
152
162
  val intent = Intent(context, FullscreenPlayerActivity::class.java)
153
- intent.putExtra(VideoManager.INTENT_PLAYER_KEY, id)
163
+ intent.putExtra(VideoManager.INTENT_PLAYER_KEY, videoViewId)
154
164
  // Set before starting the activity to avoid entering PiP unintentionally
155
165
  isInFullscreen = true
156
166
  currentActivity.startActivity(intent)
@@ -301,6 +311,34 @@ class VideoView(context: Context, appContext: AppContext) : ExpoView(context, ap
301
311
  applyAutoEnterPiP(currentActivity, false)
302
312
  }
303
313
 
314
+ // After adding the `PlayerView` to the hierarchy the touch events stop being emitted to the JS side.
315
+ // The only workaround I have found is to dispatch the touch events manually using the `EventDispatcher`.
316
+ // The behavior is different when the native controls are enabled and disabled.
317
+ override fun onTouchEvent(event: MotionEvent?): Boolean {
318
+ if (!useNativeControls) {
319
+ event?.eventTime?.let {
320
+ touchEventCoalescingKeyHelper.addCoalescingKey(it)
321
+ reactNativeEventDispatcher?.dispatchMotionEvent(this@VideoView, event, touchEventCoalescingKeyHelper)
322
+ }
323
+ }
324
+ if (event?.actionMasked == MotionEvent.ACTION_UP) {
325
+ performClick()
326
+ }
327
+ // Mark the event as handled
328
+ return true
329
+ }
330
+
331
+ override fun onInterceptTouchEvent(event: MotionEvent?): Boolean {
332
+ if (useNativeControls) {
333
+ event?.eventTime?.let {
334
+ touchEventCoalescingKeyHelper.addCoalescingKey(it)
335
+ reactNativeEventDispatcher?.dispatchMotionEvent(this@VideoView, MotionEvent.obtainNoHistory(event), touchEventCoalescingKeyHelper)
336
+ }
337
+ }
338
+ // Return false to receive all other events before the target `onTouchEvent`
339
+ return false
340
+ }
341
+
304
342
  companion object {
305
343
  fun isPictureInPictureSupported(currentActivity: Activity): Boolean {
306
344
  return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && currentActivity.packageManager.hasSystemFeature(
@@ -0,0 +1,43 @@
1
+ package expo.modules.video.utils
2
+
3
+ import android.util.Log
4
+ import android.view.MotionEvent
5
+ import android.view.View
6
+ import com.facebook.react.uimanager.UIManagerHelper
7
+ import com.facebook.react.uimanager.events.EventDispatcher
8
+ import com.facebook.react.uimanager.events.TouchEvent
9
+ import com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper
10
+ import com.facebook.react.uimanager.events.TouchEventType
11
+
12
+ internal fun EventDispatcher.dispatchMotionEvent(view: View, event: MotionEvent?, touchEventCoalescingKeyHelper: TouchEventCoalescingKeyHelper) {
13
+ if (event == null) {
14
+ return
15
+ }
16
+
17
+ try {
18
+ val event = TouchEvent.obtain(
19
+ UIManagerHelper.getSurfaceId(view),
20
+ view.id,
21
+ event.toTouchEventType(),
22
+ event,
23
+ event.eventTime,
24
+ event.x,
25
+ event.y,
26
+ touchEventCoalescingKeyHelper
27
+ )
28
+ dispatchEvent(event)
29
+ } catch (e: RuntimeException) {
30
+ // We are not expecting any issues, but we want to prevent crashes in case the dispatch fails for any reason.
31
+ Log.e("EventDispatcherUtils", "Error dispatching touch event", e)
32
+ }
33
+ }
34
+
35
+ private fun MotionEvent.toTouchEventType(): TouchEventType {
36
+ return when (this.actionMasked) {
37
+ MotionEvent.ACTION_DOWN -> TouchEventType.START
38
+ MotionEvent.ACTION_UP -> TouchEventType.END
39
+ MotionEvent.ACTION_MOVE -> TouchEventType.MOVE
40
+ MotionEvent.ACTION_CANCEL -> TouchEventType.CANCEL
41
+ else -> TouchEventType.CANCEL
42
+ }
43
+ }
@@ -30,12 +30,14 @@ export function useVideoPlayer(source, setup) {
30
30
  }
31
31
  function parseSource(source) {
32
32
  if (typeof source === 'number') {
33
+ // TODO(@kitten): This seems to not handle the `null` case. Is this correct?
33
34
  return { uri: resolveAssetSource(source).uri };
34
35
  }
35
36
  else if (typeof source === 'string') {
36
37
  return { uri: source };
37
38
  }
38
39
  if (typeof source?.assetId === 'number' && !source.uri) {
40
+ // TODO(@kitten): This seems to not handle the `null` case. Is this correct?
39
41
  return { ...source, uri: resolveAssetSource(source.assetId).uri };
40
42
  }
41
43
  return source;
@@ -1 +1 @@
1
- {"version":3,"file":"VideoPlayer.js","sourceRoot":"","sources":["../src/VideoPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,4HAA4H;AAC5H,MAAM,OAAO,GAAG,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;AAChE,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,MAAmB;IAC7E,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,OAAO,IAAI,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAmB,EACnB,KAAqC;IAErC,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO,wBAAwB,CAAC,GAAG,EAAE;QACnC,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC/D,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB;IACtC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;IACjD,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,OAAO,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACvD,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { useReleasingSharedObject } from 'expo-modules-core';\n\nimport NativeVideoModule from './NativeVideoModule';\nimport { VideoSource, VideoPlayer } from './VideoPlayer.types';\nimport resolveAssetSource from './resolveAssetSource';\n\n// TODO: Temporary solution until we develop a way of overriding prototypes that won't break the lazy loading of the module.\nconst replace = NativeVideoModule.VideoPlayer.prototype.replace;\nNativeVideoModule.VideoPlayer.prototype.replace = function (source: VideoSource) {\n return replace.call(this, parseSource(source));\n};\n\n/**\n * Creates a direct instance of `VideoPlayer` that doesn't release automatically.\n *\n * > **info** For most use cases you should use the [`useVideoPlayer`](#usevideoplayer) hook instead. See the [Using the VideoPlayer Directly](#using-the-videoplayer-directly) section for more details.\n * @param source\n */\nexport function createVideoPlayer(source: VideoSource): VideoPlayer {\n return new NativeVideoModule.VideoPlayer(parseSource(source));\n}\n\n/**\n * Creates a `VideoPlayer`, which will be automatically cleaned up when the component is unmounted.\n * @param source - A video source that is used to initialize the player.\n * @param setup - A function that allows setting up the player. It will run after the player is created.\n */\nexport function useVideoPlayer(\n source: VideoSource,\n setup?: (player: VideoPlayer) => void\n): VideoPlayer {\n const parsedSource = parseSource(source);\n\n return useReleasingSharedObject(() => {\n const player = new NativeVideoModule.VideoPlayer(parsedSource);\n setup?.(player);\n return player;\n }, [JSON.stringify(parsedSource)]);\n}\n\nfunction parseSource(source: VideoSource): VideoSource {\n if (typeof source === 'number') {\n return { uri: resolveAssetSource(source).uri };\n } else if (typeof source === 'string') {\n return { uri: source };\n }\n\n if (typeof source?.assetId === 'number' && !source.uri) {\n return { ...source, uri: resolveAssetSource(source.assetId).uri };\n }\n return source;\n}\n"]}
1
+ {"version":3,"file":"VideoPlayer.js","sourceRoot":"","sources":["../src/VideoPlayer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,iBAAiB,MAAM,qBAAqB,CAAC;AAEpD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,4HAA4H;AAC5H,MAAM,OAAO,GAAG,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;AAChE,iBAAiB,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,GAAG,UAAU,MAAmB;IAC7E,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAmB;IACnD,OAAO,IAAI,iBAAiB,CAAC,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AAChE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAmB,EACnB,KAAqC;IAErC,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IAEzC,OAAO,wBAAwB,CAAC,GAAG,EAAE;QACnC,MAAM,MAAM,GAAG,IAAI,iBAAiB,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC;QAC/D,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC;QAChB,OAAO,MAAM,CAAC;IAChB,CAAC,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,WAAW,CAAC,MAAmB;IACtC,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/B,4EAA4E;QAC5E,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAE,CAAC,GAAG,EAAE,CAAC;IAClD,CAAC;SAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QACtC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IACzB,CAAC;IAED,IAAI,OAAO,MAAM,EAAE,OAAO,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;QACvD,4EAA4E;QAC5E,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAE,CAAC,GAAG,EAAE,CAAC;IACrE,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { useReleasingSharedObject } from 'expo-modules-core';\n\nimport NativeVideoModule from './NativeVideoModule';\nimport { VideoSource, VideoPlayer } from './VideoPlayer.types';\nimport resolveAssetSource from './resolveAssetSource';\n\n// TODO: Temporary solution until we develop a way of overriding prototypes that won't break the lazy loading of the module.\nconst replace = NativeVideoModule.VideoPlayer.prototype.replace;\nNativeVideoModule.VideoPlayer.prototype.replace = function (source: VideoSource) {\n return replace.call(this, parseSource(source));\n};\n\n/**\n * Creates a direct instance of `VideoPlayer` that doesn't release automatically.\n *\n * > **info** For most use cases you should use the [`useVideoPlayer`](#usevideoplayer) hook instead. See the [Using the VideoPlayer Directly](#using-the-videoplayer-directly) section for more details.\n * @param source\n */\nexport function createVideoPlayer(source: VideoSource): VideoPlayer {\n return new NativeVideoModule.VideoPlayer(parseSource(source));\n}\n\n/**\n * Creates a `VideoPlayer`, which will be automatically cleaned up when the component is unmounted.\n * @param source - A video source that is used to initialize the player.\n * @param setup - A function that allows setting up the player. It will run after the player is created.\n */\nexport function useVideoPlayer(\n source: VideoSource,\n setup?: (player: VideoPlayer) => void\n): VideoPlayer {\n const parsedSource = parseSource(source);\n\n return useReleasingSharedObject(() => {\n const player = new NativeVideoModule.VideoPlayer(parsedSource);\n setup?.(player);\n return player;\n }, [JSON.stringify(parsedSource)]);\n}\n\nfunction parseSource(source: VideoSource): VideoSource {\n if (typeof source === 'number') {\n // TODO(@kitten): This seems to not handle the `null` case. Is this correct?\n return { uri: resolveAssetSource(source)!.uri };\n } else if (typeof source === 'string') {\n return { uri: source };\n }\n\n if (typeof source?.assetId === 'number' && !source.uri) {\n // TODO(@kitten): This seems to not handle the `null` case. Is this correct?\n return { ...source, uri: resolveAssetSource(source.assetId)!.uri };\n }\n return source;\n}\n"]}
@@ -8,7 +8,7 @@
8
8
  "publication": {
9
9
  "groupId": "host.exp.exponent",
10
10
  "artifactId": "expo.modules.video",
11
- "version": "2.1.1",
11
+ "version": "2.1.3",
12
12
  "repository": "local-maven-repo"
13
13
  }
14
14
  }
@@ -0,0 +1 @@
1
+ ca2000adb022f981431094a4ad014e103116a126cafd5bd41e706422d4b179be
@@ -0,0 +1 @@
1
+ 2509696ec25ef84f5e3a22a88bf18519e48dea98395b4f5acc0b6564d97b9192702b610b8d9aced47ee1cd1140312eff1a4153e98abf994f9a1b5780b925812f
@@ -0,0 +1 @@
1
+ 50c1aaa6681cb1d3d5516f2e01caa09293c49d8e
@@ -0,0 +1 @@
1
+ 293bca0ed8757b38175410f8416a93a57c121db0618d7ab3fdede1b679698ffb
@@ -0,0 +1 @@
1
+ 0fe5243d22365ebf9b162dd1fbbfc2926d8ec52f47f87e78b5624cf5b866ab844bb5abe4d91da9ced3ed2baa795ad55d6a48ddf346557912439684a0f245bb03
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.video",
6
- "version": "2.1.1",
6
+ "version": "2.1.3",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,13 +24,13 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.video-2.1.1.aar",
28
- "url": "expo.modules.video-2.1.1.aar",
29
- "size": 371162,
30
- "sha512": "c0defe8fc70309f03e4ab03ae098707df32266d9ed60476008fda07faf89b3e943f0fe7364e9f582d59cd44081601e2cb8382aaf1e1769a1b59e85a83854bc59",
31
- "sha256": "0ddf26351b4674406935f588548be46988e8911349703708e92f449212bd9b14",
32
- "sha1": "1b834babead335028e712e57b9581d6e2a2d3549",
33
- "md5": "16c628c4b68988e85b75207f8ada66e1"
27
+ "name": "expo.modules.video-2.1.3.aar",
28
+ "url": "expo.modules.video-2.1.3.aar",
29
+ "size": 373538,
30
+ "sha512": "0fe5243d22365ebf9b162dd1fbbfc2926d8ec52f47f87e78b5624cf5b866ab844bb5abe4d91da9ced3ed2baa795ad55d6a48ddf346557912439684a0f245bb03",
31
+ "sha256": "293bca0ed8757b38175410f8416a93a57c121db0618d7ab3fdede1b679698ffb",
32
+ "sha1": "50c1aaa6681cb1d3d5516f2e01caa09293c49d8e",
33
+ "md5": "4b064331dc548a7085c669f7dac121b8"
34
34
  }
35
35
  ]
36
36
  },
@@ -113,13 +113,13 @@
113
113
  ],
114
114
  "files": [
115
115
  {
116
- "name": "expo.modules.video-2.1.1.aar",
117
- "url": "expo.modules.video-2.1.1.aar",
118
- "size": 371162,
119
- "sha512": "c0defe8fc70309f03e4ab03ae098707df32266d9ed60476008fda07faf89b3e943f0fe7364e9f582d59cd44081601e2cb8382aaf1e1769a1b59e85a83854bc59",
120
- "sha256": "0ddf26351b4674406935f588548be46988e8911349703708e92f449212bd9b14",
121
- "sha1": "1b834babead335028e712e57b9581d6e2a2d3549",
122
- "md5": "16c628c4b68988e85b75207f8ada66e1"
116
+ "name": "expo.modules.video-2.1.3.aar",
117
+ "url": "expo.modules.video-2.1.3.aar",
118
+ "size": 373538,
119
+ "sha512": "0fe5243d22365ebf9b162dd1fbbfc2926d8ec52f47f87e78b5624cf5b866ab844bb5abe4d91da9ced3ed2baa795ad55d6a48ddf346557912439684a0f245bb03",
120
+ "sha256": "293bca0ed8757b38175410f8416a93a57c121db0618d7ab3fdede1b679698ffb",
121
+ "sha1": "50c1aaa6681cb1d3d5516f2e01caa09293c49d8e",
122
+ "md5": "4b064331dc548a7085c669f7dac121b8"
123
123
  }
124
124
  ]
125
125
  },
@@ -133,13 +133,13 @@
133
133
  },
134
134
  "files": [
135
135
  {
136
- "name": "expo.modules.video-2.1.1-sources.jar",
137
- "url": "expo.modules.video-2.1.1-sources.jar",
138
- "size": 48605,
139
- "sha512": "825cb0b1997d6a96c6d31a7e6d43357e66198539d8b77d6d67b11c59fc6da3afa58e2d7df82807ff6be1c02e893219f9506a419eb595758041cdd90ee285e491",
140
- "sha256": "744a72e25f0078fd4c4fcbe9e7837ba941dfa2782fa5796581616c007f8d73ff",
141
- "sha1": "f8bf392a47dfa5fdbd07b46893df64e03be92c9e",
142
- "md5": "d1f1e7f4ef4473ee718c60316fca9e2b"
136
+ "name": "expo.modules.video-2.1.3-sources.jar",
137
+ "url": "expo.modules.video-2.1.3-sources.jar",
138
+ "size": 49755,
139
+ "sha512": "2509696ec25ef84f5e3a22a88bf18519e48dea98395b4f5acc0b6564d97b9192702b610b8d9aced47ee1cd1140312eff1a4153e98abf994f9a1b5780b925812f",
140
+ "sha256": "ca2000adb022f981431094a4ad014e103116a126cafd5bd41e706422d4b179be",
141
+ "sha1": "54c0b6dc1b81376beb3a618b931c7b6c1ae29c1f",
142
+ "md5": "6912f84f2796567d794831d2129d410b"
143
143
  }
144
144
  ]
145
145
  }
@@ -0,0 +1 @@
1
+ 37bb9e0125f0d518e1e2388f31c1699ff3b64ac65e42e686422c08c8d8913ebb
@@ -0,0 +1 @@
1
+ 13d97ced262f06c3387a22117acb3fac8b37ecdabf3ee5114e222416581ebbb6a530bccaf0a2c189d6f5ebcb998d737b39ed76617a12bb2a332e6d8f4ec0c8e7
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.video</artifactId>
12
- <version>2.1.1</version>
12
+ <version>2.1.3</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.video</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ df7e49aad154fa77fb882912bec8e6aa9ff6018c
@@ -0,0 +1 @@
1
+ 7f1afeb663fea378d066d31585217402fa9f12dcda29f7efd9782ab0a49842ef
@@ -0,0 +1 @@
1
+ bbe2a4b87630569da7b413394b147cce08e8ec8f69c7d95d73edea79278b303997144d4a9dcc96362aaf203e0aa1aaec53ad33ebe9f818df1c52bb902ad74737
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.video</artifactId>
5
5
  <versioning>
6
- <latest>2.1.1</latest>
7
- <release>2.1.1</release>
6
+ <latest>2.1.3</latest>
7
+ <release>2.1.3</release>
8
8
  <versions>
9
- <version>2.1.1</version>
9
+ <version>2.1.3</version>
10
10
  </versions>
11
- <lastUpdated>20250409202814</lastUpdated>
11
+ <lastUpdated>20250421213312</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- abbf85d7931b32ffe8cf3c6a3e68d3f2
1
+ 852c77ac4e6adb5d770fb976d4d627c3
@@ -1 +1 @@
1
- b61d15075a26208eab23dc5a3cf5a06ee0d8d1cf
1
+ d89a79b8fd7f7459b98c6b77c75d70836ebfddfc
@@ -1 +1 @@
1
- 9bfcae4d1104aee2a6e9611398477c9dd5d6c7e782058afba24506818927e7b8
1
+ 9af0b3271a3472c47264630ead2d1a8a7cca0da33d498dc87e06ea1fdf6affb9
@@ -1 +1 @@
1
- 8d31c0d057ea43b744e5792de22c6ad9e9a58a13bff5f715854bfb88d0df4742d7e198589904f44b9918621a34a4d76aa3ed49f361c0800bdac3047c4f231928
1
+ 18943f0a542f164b0a7756d214847d8f9e16586c39a1c5c0d6574b24cbb5c5e7b2cc008f3bcb942fc58b73b26c0a5a0094e71debeb8cc53a234d68f37d7623b8
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "expo-video",
3
3
  "title": "Expo Video",
4
- "version": "2.1.1",
4
+ "version": "2.1.3",
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",
@@ -31,12 +31,12 @@
31
31
  "license": "MIT",
32
32
  "dependencies": {},
33
33
  "devDependencies": {
34
- "expo-module-scripts": "^4.1.1"
34
+ "expo-module-scripts": "^4.1.2"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "expo": "*",
38
38
  "react": "*",
39
39
  "react-native": "*"
40
40
  },
41
- "gitHead": "1914bb35d23af23078da37e70988261844436505"
41
+ "gitHead": "f1394f21ff2719a9a3037d7511db170704e5c492"
42
42
  }
@@ -40,13 +40,15 @@ export function useVideoPlayer(
40
40
 
41
41
  function parseSource(source: VideoSource): VideoSource {
42
42
  if (typeof source === 'number') {
43
- return { uri: resolveAssetSource(source).uri };
43
+ // TODO(@kitten): This seems to not handle the `null` case. Is this correct?
44
+ return { uri: resolveAssetSource(source)!.uri };
44
45
  } else if (typeof source === 'string') {
45
46
  return { uri: source };
46
47
  }
47
48
 
48
49
  if (typeof source?.assetId === 'number' && !source.uri) {
49
- return { ...source, uri: resolveAssetSource(source.assetId).uri };
50
+ // TODO(@kitten): This seems to not handle the `null` case. Is this correct?
51
+ return { ...source, uri: resolveAssetSource(source.assetId)!.uri };
50
52
  }
51
53
  return source;
52
54
  }
@@ -0,0 +1 @@
1
+ /// <reference path="../../../expo-asset/src/ts-declarations/react-native-assets.d.ts" />
@@ -1 +0,0 @@
1
- 744a72e25f0078fd4c4fcbe9e7837ba941dfa2782fa5796581616c007f8d73ff
@@ -1 +0,0 @@
1
- 825cb0b1997d6a96c6d31a7e6d43357e66198539d8b77d6d67b11c59fc6da3afa58e2d7df82807ff6be1c02e893219f9506a419eb595758041cdd90ee285e491
@@ -1 +0,0 @@
1
- 1b834babead335028e712e57b9581d6e2a2d3549
@@ -1 +0,0 @@
1
- 0ddf26351b4674406935f588548be46988e8911349703708e92f449212bd9b14
@@ -1 +0,0 @@
1
- c0defe8fc70309f03e4ab03ae098707df32266d9ed60476008fda07faf89b3e943f0fe7364e9f582d59cd44081601e2cb8382aaf1e1769a1b59e85a83854bc59
@@ -1 +0,0 @@
1
- d24f91f94267766be2019023a0a70c078ff555e5
@@ -1 +0,0 @@
1
- cf60af111fd5f3f56e742d8358d14972ebccbe7f98c964dc19323611b19f6695
@@ -1 +0,0 @@
1
- 7252bf75b382fddaabcda8929d974a621d6ef7ccc0be1ff2d8bd8dca752168ccc382bbcf9cbac192969851049603874c77a484443693bf94b9078411cb1df27e
@@ -1 +0,0 @@
1
- 4ab857d50d57e420a276dfe9765e9e39fc32c17c
@@ -1 +0,0 @@
1
- 91d3880bdbcf52db3faa93264f9ced99b580125b58db46a6f763508529072b9e
@@ -1 +0,0 @@
1
- 573b02be17b27eeb87714ae9d899a20984cabcb030ae9ed0fc58db3b7631cf6d7d547bde328903eaf58acc1bad354d4859a149e9a07f696b40a3442043821174