(expo-av) videoRef to Video component seems incomplete when app foregrounded...

Hi, thanks in advance!

Here is my env:

  1. SDK Version: v38
  2. Platforms(Android/iOS/web/all): iOS

I’m using the expo-av Video component. When I foreground the app the video is not starting again automatically (though shouldPlay is true). So I’d like to restart it manually.

Having stored the ref to the component in const videoRef I’m trying to call playAsync() using it however, playAsync() is not a function on the ref.

Below I’ve pasted what is in the ref object by cloning the videoRef object, deleting the very large _nativeRef key and stringify’ing it.

The videoRef does end up including many functions but is clearly missing a few from the component’s API like playAsync() and playFromPositionAsync().

Any thoughts would be helpful.

Per

VideoTestScreen screen to Foreground Object {
  "_handleNewStatus": [Function anonymous],
  "_nativeOnError": [Function anonymous],
  "_nativeOnFullscreenUpdate": [Function anonymous],
  "_nativeOnLoad": [Function anonymous],
  "_nativeOnLoadStart": [Function anonymous],
  "_nativeOnPlaybackStatusUpdate": [Function anonymous],
  "_nativeOnReadyForDisplay": [Function anonymous],
  "_onPlaybackStatusUpdate": null,
  "_performOperationAndHandleStatusAsync": [Function _callee],
  "_reactInternalFiber": FiberNode {
    "tag": 1,
    "key": null,
    "type": [Function Video],
  },
  "_reactInternalInstance": Object {},
  "_renderPoster": [Function anonymous],
  "_setFullscreen": [Function _callee2],
  "context": Object {},
  "dismissFullscreenPlayer": [Function _callee5],
  "dismissIOSFullscreenPlayer": [Function anonymous],
  "getStatusAsync": [Function _callee6],
  "loadAsync": [Function _callee7],
  "presentFullscreenPlayer": [Function _callee3],
  "presentFullscreenPlayerAsync": [Function _callee4],
  "presentIOSFullscreenPlayer": [Function anonymous],
  "props": Object {
    "isMuted": false,
    "onError": [Function _onError],
    "onFullscreenUpdate": [Function _onFullscreenUpdate],
    "onLayout": [Function anonymous],
    "onLoad": [Function _onLoad],
    "onLoadStart": [Function _onLoadStart],
    "onPlaybackStatusUpdate": [Function _onPlaybackStatusUpdate],
    "onReadyForDisplay": [Function _onReadyForDisplay],
    "posterSource": Object {
      "uri": "https://...",
    },
    "posterStyle": Object {
      "backgroundColor": "#000",
      "height": "100%",
      "width": "100%",
    },
    "progressUpdateIntervalMillis": 250,
    "rate": 1,
    "resizeMode": "contain",
    "shouldPlay": true,
    "source": Object {
      "uri": "https://...",
    },
    "style": Array [
      Object {},
      Object {
        "height": 431.6627634660421,
        "width": 768,
      },
    ],
    "useNativeControls": true,
    "usePoster": true,
    "volume": 1,
  },
  "refs": Object {},
  "replayAsync": [Function _callee10],
  "setStatusAsync": [Function _callee9],
  "state": Object {
    "showPoster": false,
  },
  "unloadAsync": [Function _callee8],
  "updater": Object {
    "enqueueForceUpdate": [Function enqueueForceUpdate],
    "enqueueReplaceState": [Function enqueueReplaceState],
    "enqueueSetState": [Function enqueueSetState],
    "isMounted": [Function isMounted],
  },
}

Fixed! Was incorrectly managing ref with child player.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.