Extract the react-native-video view tag from an event payload.
Compatible with any rnv callback — pass the payload straight through:
onLoad={(data) => setTag(getReactVideoViewTag(data))}. Returns
undefined when the payload carries no usable target (non-numeric,
non-finite, or missing), so callers can ignore malformed events.
This is the supported way to obtain the view tag for createOptiViewAds:
findNodeHandle(videoRef.current) throws for react-native-video v6,
whose ref is an imperative-methods object, not a host component.
Extract the
react-native-videoview tag from an event payload.Compatible with any rnv callback — pass the payload straight through:
onLoad={(data) => setTag(getReactVideoViewTag(data))}. Returnsundefinedwhen the payload carries no usabletarget(non-numeric, non-finite, or missing), so callers can ignore malformed events.This is the supported way to obtain the view tag for
createOptiViewAds:findNodeHandle(videoRef.current)throws for react-native-video v6, whose ref is an imperative-methods object, not a host component.