@planningcenter/chat-react-native 3.46.0-rc.0 → 4.0.0-rc.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.
@@ -1 +1 @@
1
- {"version":3,"file":"video_attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/video_attachment.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qCAAqC,EAAE,MAAM,2DAA2D,CAAA;AAOjH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,4BAA4B,EAC5B,UAAU,GACX,EAAE;IACD,UAAU,EAAE,qCAAqC,CAAA;IACjD,4BAA4B,EAAE,CAAC,UAAU,EAAE,qCAAqC,KAAK,IAAI,CAAA;IACzF,UAAU,EAAE,OAAO,CAAA;CACpB,2CA6DA"}
1
+ {"version":3,"file":"video_attachment.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/video_attachment.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,qCAAqC,EAAE,MAAM,2DAA2D,CAAA;AAOjH,wBAAgB,eAAe,CAAC,EAC9B,UAAU,EACV,4BAA4B,EAC5B,UAAU,GACX,EAAE;IACD,UAAU,EAAE,qCAAqC,CAAA;IACjD,4BAA4B,EAAE,CAAC,UAAU,EAAE,qCAAqC,KAAK,IAAI,CAAA;IACzF,UAAU,EAAE,OAAO,CAAA;CACpB,2CA4DA"}
@@ -28,7 +28,7 @@ export function VideoAttachment({ attachment, onMessageAttachmentLongPress, isDe
28
28
  setIsOpen(false);
29
29
  }
30
30
  const viewRef = useRef(null);
31
- return (_jsx(View, { style: styles.container, ref: viewRef, children: _jsxs(PlatformPressable, { onPress: openVideo, onLongPress: () => !isDeleting && onMessageAttachmentLongPress(attachment), android_ripple: { color: colors.androidRippleNeutral, foreground: true }, accessibilityLabel: "Play Video", accessibilityHint: "Press to play video. Long press for more options", disabled: isDeleting, children: [_jsx(View, { style: styles.thumbnailOverlay }), _jsx(Video.Player, { ref: videoRef, source: { uri: url }, aspectRatio: width / height, style: styles.video, onFullscreenPlayerWillDismiss: closeVideo, onFullscreenPlayerDidDismiss: closeVideo }), !isOpen && !isDeleting && (_jsx(View, { style: styles.playContainer, children: _jsx(View, { style: styles.playCircle, children: _jsx(Icon, { name: "services.play", style: styles.playIcon, accessibilityElementsHidden: true }) }) })), isDeleting && _jsx(AttachmentDeletingOverlay, {})] }) }));
31
+ return (_jsx(View, { style: styles.container, ref: viewRef, children: _jsxs(PlatformPressable, { onPress: openVideo, onLongPress: () => !isDeleting && onMessageAttachmentLongPress(attachment), android_ripple: { color: colors.androidRippleNeutral, foreground: true }, accessibilityLabel: "Play Video", accessibilityHint: "Press to play video. Long press for more options", disabled: isDeleting, children: [_jsx(View, { style: styles.thumbnailOverlay }), _jsx(Video.Player, { ref: videoRef, source: { uri: url }, aspectRatio: width / height, style: styles.video, onFullscreenDismiss: closeVideo }), !isOpen && !isDeleting && (_jsx(View, { style: styles.playContainer, children: _jsx(View, { style: styles.playCircle, children: _jsx(Icon, { name: "services.play", style: styles.playIcon, accessibilityElementsHidden: true }) }) })), isDeleting && _jsx(AttachmentDeletingOverlay, {})] }) }));
32
32
  }
33
33
  const OVERLAY_Z_INDEX = 1;
34
34
  const useStyles = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"video_attachment.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/video_attachment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAqB,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,IAAI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SACnB;QACD,KAAK,EAAE;YACL,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,MAAM,CAAC,mBAAmB;SAC5C;QACD,gBAAgB,EAAE;YAChB,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,eAAe,EAAE,sBAAsB;YACvC,MAAM,EAAE,eAAe;SACxB;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,eAAe,GAAG,CAAC;SAC5B;QACD,UAAU,EAAE;YACV,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,WAAW,EAAE,CAAC;SACf;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport React, { useRef, useState } from 'react'\nimport { View, StyleSheet } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { DenormalizedMessageAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { Video, VideoPlayerHandle } from '../../../utils/native_adapters'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { Icon } from '../../display'\nimport { AttachmentDeletingOverlay } from './attachment_deleting_overlay'\nimport { MESSAGE_ATTACHMENT_WIDTH_SINGLE } from './constants'\n\nexport function VideoAttachment({\n attachment,\n onMessageAttachmentLongPress,\n isDeleting,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n onMessageAttachmentLongPress: (attachment: DenormalizedMessageAttachmentResource) => void\n isDeleting: boolean\n}) {\n const { colors } = useTheme()\n const styles = useStyles()\n\n const { attributes } = attachment\n const { width = MESSAGE_ATTACHMENT_WIDTH_SINGLE, height = MESSAGE_ATTACHMENT_WIDTH_SINGLE } =\n attributes.metadata || {}\n const { url } = attributes\n\n const videoRef = useRef<VideoPlayerHandle>(null)\n const [isOpen, setIsOpen] = useState(false)\n\n function openVideo() {\n if (!isOpen && videoRef.current) {\n videoRef.current.presentFullscreenPlayer()\n videoRef.current.play()\n setIsOpen(true)\n }\n }\n\n function closeVideo() {\n videoRef.current?.pause()\n setIsOpen(false)\n }\n\n const viewRef = useRef<View>(null)\n\n return (\n <View style={styles.container} ref={viewRef}>\n <PlatformPressable\n onPress={openVideo}\n onLongPress={() => !isDeleting && onMessageAttachmentLongPress(attachment)}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n accessibilityLabel=\"Play Video\"\n accessibilityHint=\"Press to play video. Long press for more options\"\n disabled={isDeleting}\n >\n <View style={styles.thumbnailOverlay} />\n <Video.Player\n ref={videoRef}\n source={{ uri: url }}\n aspectRatio={width / height}\n style={styles.video}\n onFullscreenPlayerWillDismiss={closeVideo}\n onFullscreenPlayerDidDismiss={closeVideo}\n />\n {!isOpen && !isDeleting && (\n <View style={styles.playContainer}>\n <View style={styles.playCircle}>\n <Icon\n name=\"services.play\"\n style={styles.playIcon}\n accessibilityElementsHidden={true}\n />\n </View>\n </View>\n )}\n {isDeleting && <AttachmentDeletingOverlay />}\n </PlatformPressable>\n </View>\n )\n}\nconst OVERLAY_Z_INDEX = 1\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const overlayBackgroundColor =\n colors.name === 'light'\n ? tokens.fillColorTransparencyDark010\n : tokens.fillColorTransparencyDark030\n\n return StyleSheet.create({\n container: {\n borderRadius: 8,\n overflow: 'hidden',\n },\n video: {\n width: '100%',\n backgroundColor: colors.fillColorNeutral070,\n },\n thumbnailOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: overlayBackgroundColor,\n zIndex: OVERLAY_Z_INDEX,\n },\n playContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: OVERLAY_Z_INDEX + 1,\n },\n playCircle: {\n justifyContent: 'center',\n alignItems: 'center',\n width: 42,\n height: 42,\n borderRadius: 25,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n },\n playIcon: {\n fontSize: 20,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"video_attachment.js","sourceRoot":"","sources":["../../../../src/components/conversation/attachments/video_attachment.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC/C,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,KAAK,EAAqB,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AACxD,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAA;AACzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAA;AAE7D,MAAM,UAAU,eAAe,CAAC,EAC9B,UAAU,EACV,4BAA4B,EAC5B,UAAU,GAKX;IACC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC7B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAA;I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K,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,eAAe,GAAG,CAAC;SAC5B;QACD,UAAU,EAAE;YACV,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,KAAK,EAAE,EAAE;YACT,MAAM,EAAE,EAAE;YACV,YAAY,EAAE,EAAE;YAChB,eAAe,EAAE,MAAM,CAAC,2BAA2B;YACnD,WAAW,EAAE,MAAM,CAAC,sBAAsB;YAC1C,WAAW,EAAE,CAAC;SACf;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;SACb;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport React, { useRef, useState } from 'react'\nimport { View, StyleSheet } from 'react-native'\nimport { useTheme } from '../../../hooks'\nimport { DenormalizedMessageAttachmentResource } from '../../../types/resources/denormalized_attachment_resource'\nimport { Video, VideoPlayerHandle } from '../../../utils/native_adapters'\nimport { tokens } from '../../../vendor/tapestry/tokens'\nimport { Icon } from '../../display'\nimport { AttachmentDeletingOverlay } from './attachment_deleting_overlay'\nimport { MESSAGE_ATTACHMENT_WIDTH_SINGLE } from './constants'\n\nexport function VideoAttachment({\n attachment,\n onMessageAttachmentLongPress,\n isDeleting,\n}: {\n attachment: DenormalizedMessageAttachmentResource\n onMessageAttachmentLongPress: (attachment: DenormalizedMessageAttachmentResource) => void\n isDeleting: boolean\n}) {\n const { colors } = useTheme()\n const styles = useStyles()\n\n const { attributes } = attachment\n const { width = MESSAGE_ATTACHMENT_WIDTH_SINGLE, height = MESSAGE_ATTACHMENT_WIDTH_SINGLE } =\n attributes.metadata || {}\n const { url } = attributes\n\n const videoRef = useRef<VideoPlayerHandle>(null)\n const [isOpen, setIsOpen] = useState(false)\n\n function openVideo() {\n if (!isOpen && videoRef.current) {\n videoRef.current.presentFullscreenPlayer()\n videoRef.current.play()\n setIsOpen(true)\n }\n }\n\n function closeVideo() {\n videoRef.current?.pause()\n setIsOpen(false)\n }\n\n const viewRef = useRef<View>(null)\n\n return (\n <View style={styles.container} ref={viewRef}>\n <PlatformPressable\n onPress={openVideo}\n onLongPress={() => !isDeleting && onMessageAttachmentLongPress(attachment)}\n android_ripple={{ color: colors.androidRippleNeutral, foreground: true }}\n accessibilityLabel=\"Play Video\"\n accessibilityHint=\"Press to play video. Long press for more options\"\n disabled={isDeleting}\n >\n <View style={styles.thumbnailOverlay} />\n <Video.Player\n ref={videoRef}\n source={{ uri: url }}\n aspectRatio={width / height}\n style={styles.video}\n onFullscreenDismiss={closeVideo}\n />\n {!isOpen && !isDeleting && (\n <View style={styles.playContainer}>\n <View style={styles.playCircle}>\n <Icon\n name=\"services.play\"\n style={styles.playIcon}\n accessibilityElementsHidden={true}\n />\n </View>\n </View>\n )}\n {isDeleting && <AttachmentDeletingOverlay />}\n </PlatformPressable>\n </View>\n )\n}\nconst OVERLAY_Z_INDEX = 1\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const overlayBackgroundColor =\n colors.name === 'light'\n ? tokens.fillColorTransparencyDark010\n : tokens.fillColorTransparencyDark030\n\n return StyleSheet.create({\n container: {\n borderRadius: 8,\n overflow: 'hidden',\n },\n video: {\n width: '100%',\n backgroundColor: colors.fillColorNeutral070,\n },\n thumbnailOverlay: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n backgroundColor: overlayBackgroundColor,\n zIndex: OVERLAY_Z_INDEX,\n },\n playContainer: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n justifyContent: 'center',\n alignItems: 'center',\n zIndex: OVERLAY_Z_INDEX + 1,\n },\n playCircle: {\n justifyContent: 'center',\n alignItems: 'center',\n width: 42,\n height: 42,\n borderRadius: 25,\n backgroundColor: colors.fillColorNeutral100Inverted,\n borderColor: colors.borderColorDefaultBase,\n borderWidth: 1,\n },\n playIcon: {\n fontSize: 20,\n },\n })\n}\n"]}
@@ -5,10 +5,7 @@ export interface VideoPlayerProps {
5
5
  };
6
6
  aspectRatio?: number;
7
7
  style?: StyleProp<ViewStyle>;
8
- onFullscreenPlayerWillPresent?: () => void;
9
- onFullscreenPlayerDidPresent?: () => void;
10
- onFullscreenPlayerWillDismiss?: () => void;
11
- onFullscreenPlayerDidDismiss?: () => void;
8
+ onFullscreenDismiss: () => void;
12
9
  }
13
10
  export interface VideoPlayerHandle {
14
11
  play: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1C,4BAA4B,CAAC,EAAE,MAAM,IAAI,CAAA;IACzC,6BAA6B,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1C,4BAA4B,CAAC,EAAE,MAAM,IAAI,CAAA;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,uBAAuB,EAAE,MAAM,IAAI,CAAA;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED,KAAK,WAAW,GAAG,KAAK,CAAC,yBAAyB,CAChD,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAC1D,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,EAAE,WAAW,CAAA;gBAEP,OAAO,EAAE,YAAY;CAGlC"}
1
+ {"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/video.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAEnD,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAC5B,mBAAmB,EAAE,MAAM,IAAI,CAAA;CAChC;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,uBAAuB,EAAE,MAAM,IAAI,CAAA;IACnC,iBAAiB,EAAE,MAAM,IAAI,CAAA;CAC9B;AAED,KAAK,WAAW,GAAG,KAAK,CAAC,yBAAyB,CAChD,gBAAgB,GAAG,KAAK,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAC1D,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,EAAE,WAAW,CAAA;gBAEP,OAAO,EAAE,YAAY;CAGlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/video.ts"],"names":[],"mappings":"AAuBA,MAAM,OAAO,YAAY;IACvB,MAAM,CAAa;IAEnB,YAAY,OAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,CAAC;CACF","sourcesContent":["import { StyleProp, ViewStyle } from 'react-native'\n\nexport interface VideoPlayerProps {\n source: { uri: string }\n aspectRatio?: number\n style?: StyleProp<ViewStyle>\n onFullscreenPlayerWillPresent?: () => void\n onFullscreenPlayerDidPresent?: () => void\n onFullscreenPlayerWillDismiss?: () => void\n onFullscreenPlayerDidDismiss?: () => void\n}\n\nexport interface VideoPlayerHandle {\n play: () => void\n pause: () => void\n presentFullscreenPlayer: () => void\n dismissFullscreen: () => void\n}\n\ntype VideoPlayer = React.ForwardRefExoticComponent<\n VideoPlayerProps & React.RefAttributes<VideoPlayerHandle>\n>\n\nexport class VideoAdapter {\n Player: VideoPlayer\n\n constructor(methods: VideoAdapter) {\n this.Player = methods.Player\n }\n}\n"]}
1
+ {"version":3,"file":"video.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/video.ts"],"names":[],"mappings":"AAoBA,MAAM,OAAO,YAAY;IACvB,MAAM,CAAa;IAEnB,YAAY,OAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;IAC9B,CAAC;CACF","sourcesContent":["import { StyleProp, ViewStyle } from 'react-native'\n\nexport interface VideoPlayerProps {\n source: { uri: string }\n aspectRatio?: number\n style?: StyleProp<ViewStyle>\n onFullscreenDismiss: () => void\n}\n\nexport interface VideoPlayerHandle {\n play: () => void\n pause: () => void\n presentFullscreenPlayer: () => void\n dismissFullscreen: () => void\n}\n\ntype VideoPlayer = React.ForwardRefExoticComponent<\n VideoPlayerProps & React.RefAttributes<VideoPlayerHandle>\n>\n\nexport class VideoAdapter {\n Player: VideoPlayer\n\n constructor(methods: VideoAdapter) {\n this.Player = methods.Player\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.46.0-rc.0",
3
+ "version": "4.0.0-rc.0",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
@@ -78,5 +78,5 @@
78
78
  "sf-symbols-typescript": "^2.2.0",
79
79
  "typescript": "~6.0.3"
80
80
  },
81
- "gitHead": "730694c6188522e5b88fed8ed8bb889a6e939e01"
81
+ "gitHead": "b528eaada6793bdc405230fcf0a249fb5a2389dc"
82
82
  }
@@ -96,19 +96,16 @@ describe('VideoAttachment', () => {
96
96
  expect(handle.play).toHaveBeenCalledTimes(1)
97
97
  })
98
98
 
99
- it.each(['onFullscreenPlayerWillDismiss', 'onFullscreenPlayerDidDismiss'] as const)(
100
- 'pauses and can be reopened after %s',
101
- dismissEvent => {
102
- const { getByLabelText } = renderAttachment()
103
- fireEvent.press(getByLabelText('Play Video'))
99
+ it('pauses and can be reopened after the player dismisses fullscreen', () => {
100
+ const { getByLabelText } = renderAttachment()
101
+ fireEvent.press(getByLabelText('Play Video'))
104
102
 
105
- act(() => latestPlayerProps()?.[dismissEvent]?.())
103
+ act(() => latestPlayerProps()?.onFullscreenDismiss())
106
104
 
107
- expect(handle.pause).toHaveBeenCalledTimes(1)
105
+ expect(handle.pause).toHaveBeenCalledTimes(1)
108
106
 
109
- fireEvent.press(getByLabelText('Play Video'))
107
+ fireEvent.press(getByLabelText('Play Video'))
110
108
 
111
- expect(handle.presentFullscreenPlayer).toHaveBeenCalledTimes(2)
112
- }
113
- )
109
+ expect(handle.presentFullscreenPlayer).toHaveBeenCalledTimes(2)
110
+ })
114
111
  })
@@ -60,8 +60,7 @@ export function VideoAttachment({
60
60
  source={{ uri: url }}
61
61
  aspectRatio={width / height}
62
62
  style={styles.video}
63
- onFullscreenPlayerWillDismiss={closeVideo}
64
- onFullscreenPlayerDidDismiss={closeVideo}
63
+ onFullscreenDismiss={closeVideo}
65
64
  />
66
65
  {!isOpen && !isDeleting && (
67
66
  <View style={styles.playContainer}>
@@ -4,10 +4,7 @@ export interface VideoPlayerProps {
4
4
  source: { uri: string }
5
5
  aspectRatio?: number
6
6
  style?: StyleProp<ViewStyle>
7
- onFullscreenPlayerWillPresent?: () => void
8
- onFullscreenPlayerDidPresent?: () => void
9
- onFullscreenPlayerWillDismiss?: () => void
10
- onFullscreenPlayerDidDismiss?: () => void
7
+ onFullscreenDismiss: () => void
11
8
  }
12
9
 
13
10
  export interface VideoPlayerHandle {