@100mslive/react-native-room-kit 1.1.6 → 1.1.7
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.
- package/lib/commonjs/Icons/Pause/assets/pause-med.png +0 -0
- package/lib/commonjs/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/lib/commonjs/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/lib/commonjs/Icons/Pause/index.js +35 -0
- package/lib/commonjs/Icons/Pause/index.js.map +1 -0
- package/lib/commonjs/Icons/Play/assets/play-med.png +0 -0
- package/lib/commonjs/Icons/Play/assets/play-med@2x.png +0 -0
- package/lib/commonjs/Icons/Play/assets/play-med@3x.png +0 -0
- package/lib/commonjs/Icons/Play/index.js +35 -0
- package/lib/commonjs/Icons/Play/index.js.map +1 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/lib/commonjs/Icons/SeekArrow/index.js +34 -0
- package/lib/commonjs/Icons/SeekArrow/index.js.map +1 -0
- package/lib/commonjs/Icons/index.js +33 -0
- package/lib/commonjs/Icons/index.js.map +1 -1
- package/lib/commonjs/components/HLSChatMessages.js +4 -5
- package/lib/commonjs/components/HLSChatMessages.js.map +1 -1
- package/lib/commonjs/components/HLSCloseMeetingControl.js +41 -0
- package/lib/commonjs/components/HLSCloseMeetingControl.js.map +1 -0
- package/lib/commonjs/components/HLSClosedCaptionControl.js +109 -0
- package/lib/commonjs/components/HLSClosedCaptionControl.js.map +1 -0
- package/lib/commonjs/components/HLSDistanceFromLive.js +56 -0
- package/lib/commonjs/components/HLSDistanceFromLive.js.map +1 -0
- package/lib/commonjs/components/HLSFullScreenControl.js +42 -0
- package/lib/commonjs/components/HLSFullScreenControl.js.map +1 -0
- package/lib/commonjs/components/HLSGoLiveControl.js +78 -0
- package/lib/commonjs/components/HLSGoLiveControl.js.map +1 -0
- package/lib/commonjs/components/HLSPlayPauseControl.js +62 -0
- package/lib/commonjs/components/HLSPlayPauseControl.js.map +1 -0
- package/lib/commonjs/components/HLSPlayer.js +82 -81
- package/lib/commonjs/components/HLSPlayer.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerContainer.js +62 -3
- package/lib/commonjs/components/HLSPlayerContainer.js.map +1 -1
- package/lib/commonjs/components/HLSPlayerControls.js +89 -46
- package/lib/commonjs/components/HLSPlayerControls.js.map +1 -1
- package/lib/commonjs/components/HLSSeekbackwardControl.js +67 -0
- package/lib/commonjs/components/HLSSeekbackwardControl.js.map +1 -0
- package/lib/commonjs/components/HLSSeekbar.js +285 -0
- package/lib/commonjs/components/HLSSeekbar.js.map +1 -0
- package/lib/commonjs/components/HLSSeekforwardControl.js +71 -0
- package/lib/commonjs/components/HLSSeekforwardControl.js.map +1 -0
- package/lib/commonjs/components/HMSHLSMessage.js +19 -41
- package/lib/commonjs/components/HMSHLSMessage.js.map +1 -1
- package/lib/commonjs/components/HMSHLSMessageList.js +2 -2
- package/lib/commonjs/components/HMSHLSMessageList.js.map +1 -1
- package/lib/commonjs/components/HMSOverlayMessageView.js +150 -0
- package/lib/commonjs/components/HMSOverlayMessageView.js.map +1 -0
- package/lib/commonjs/components/Participants/ParticipantsList.js +4 -4
- package/lib/commonjs/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/commonjs/hooks-util.js +30 -2
- package/lib/commonjs/hooks-util.js.map +1 -1
- package/lib/commonjs/redux/actionTypes.js +2 -0
- package/lib/commonjs/redux/actionTypes.js.map +1 -1
- package/lib/commonjs/redux/actions/index.js +10 -3
- package/lib/commonjs/redux/actions/index.js.map +1 -1
- package/lib/commonjs/redux/reducers/appState.js +9 -1
- package/lib/commonjs/redux/reducers/appState.js.map +1 -1
- package/lib/module/Icons/Pause/assets/pause-med.png +0 -0
- package/lib/module/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/lib/module/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/lib/module/Icons/Pause/index.js +27 -0
- package/lib/module/Icons/Pause/index.js.map +1 -0
- package/lib/module/Icons/Play/assets/play-med.png +0 -0
- package/lib/module/Icons/Play/assets/play-med@2x.png +0 -0
- package/lib/module/Icons/Play/assets/play-med@3x.png +0 -0
- package/lib/module/Icons/Play/index.js +27 -0
- package/lib/module/Icons/Play/index.js.map +1 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/lib/module/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/lib/module/Icons/SeekArrow/index.js +26 -0
- package/lib/module/Icons/SeekArrow/index.js.map +1 -0
- package/lib/module/Icons/index.js +3 -0
- package/lib/module/Icons/index.js.map +1 -1
- package/lib/module/components/HLSChatMessages.js +5 -6
- package/lib/module/components/HLSChatMessages.js.map +1 -1
- package/lib/module/components/HLSCloseMeetingControl.js +33 -0
- package/lib/module/components/HLSCloseMeetingControl.js.map +1 -0
- package/lib/module/components/HLSClosedCaptionControl.js +100 -0
- package/lib/module/components/HLSClosedCaptionControl.js.map +1 -0
- package/lib/module/components/HLSDistanceFromLive.js +48 -0
- package/lib/module/components/HLSDistanceFromLive.js.map +1 -0
- package/lib/module/components/HLSFullScreenControl.js +34 -0
- package/lib/module/components/HLSFullScreenControl.js.map +1 -0
- package/lib/module/components/HLSGoLiveControl.js +70 -0
- package/lib/module/components/HLSGoLiveControl.js.map +1 -0
- package/lib/module/components/HLSPlayPauseControl.js +54 -0
- package/lib/module/components/HLSPlayPauseControl.js.map +1 -0
- package/lib/module/components/HLSPlayer.js +83 -81
- package/lib/module/components/HLSPlayer.js.map +1 -1
- package/lib/module/components/HLSPlayerContainer.js +62 -3
- package/lib/module/components/HLSPlayerContainer.js.map +1 -1
- package/lib/module/components/HLSPlayerControls.js +89 -50
- package/lib/module/components/HLSPlayerControls.js.map +1 -1
- package/lib/module/components/HLSSeekbackwardControl.js +59 -0
- package/lib/module/components/HLSSeekbackwardControl.js.map +1 -0
- package/lib/module/components/HLSSeekbar.js +276 -0
- package/lib/module/components/HLSSeekbar.js.map +1 -0
- package/lib/module/components/HLSSeekforwardControl.js +63 -0
- package/lib/module/components/HLSSeekforwardControl.js.map +1 -0
- package/lib/module/components/HMSHLSMessage.js +19 -41
- package/lib/module/components/HMSHLSMessage.js.map +1 -1
- package/lib/module/components/HMSHLSMessageList.js +2 -2
- package/lib/module/components/HMSHLSMessageList.js.map +1 -1
- package/lib/module/components/HMSOverlayMessageView.js +142 -0
- package/lib/module/components/HMSOverlayMessageView.js.map +1 -0
- package/lib/module/components/Participants/ParticipantsList.js +4 -4
- package/lib/module/components/Participants/ParticipantsList.js.map +1 -1
- package/lib/module/hooks-util.js +30 -3
- package/lib/module/hooks-util.js.map +1 -1
- package/lib/module/redux/actionTypes.js +2 -0
- package/lib/module/redux/actionTypes.js.map +1 -1
- package/lib/module/redux/actions/index.js +6 -0
- package/lib/module/redux/actions/index.js.map +1 -1
- package/lib/module/redux/reducers/appState.js +9 -1
- package/lib/module/redux/reducers/appState.js.map +1 -1
- package/lib/typescript/Icons/Pause/index.d.ts +8 -0
- package/lib/typescript/Icons/Pause/index.d.ts.map +1 -0
- package/lib/typescript/Icons/Play/index.d.ts +8 -0
- package/lib/typescript/Icons/Play/index.d.ts.map +1 -0
- package/lib/typescript/Icons/SeekArrow/index.d.ts +8 -0
- package/lib/typescript/Icons/SeekArrow/index.d.ts.map +1 -0
- package/lib/typescript/Icons/index.d.ts +3 -0
- package/lib/typescript/Icons/index.d.ts.map +1 -1
- package/lib/typescript/components/CustomButton.d.ts +5 -5
- package/lib/typescript/components/CustomButton.d.ts.map +1 -1
- package/lib/typescript/components/HLSChatMessages.d.ts.map +1 -1
- package/lib/typescript/components/HLSCloseMeetingControl.d.ts +8 -0
- package/lib/typescript/components/HLSCloseMeetingControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSClosedCaptionControl.d.ts +10 -0
- package/lib/typescript/components/HLSClosedCaptionControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSDistanceFromLive.d.ts +8 -0
- package/lib/typescript/components/HLSDistanceFromLive.d.ts.map +1 -0
- package/lib/typescript/components/HLSFullScreenControl.d.ts +8 -0
- package/lib/typescript/components/HLSFullScreenControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSGoLiveControl.d.ts +10 -0
- package/lib/typescript/components/HLSGoLiveControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSPlayPauseControl.d.ts +8 -0
- package/lib/typescript/components/HLSPlayPauseControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSPlayer.d.ts +4 -2
- package/lib/typescript/components/HLSPlayer.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerContainer.d.ts.map +1 -1
- package/lib/typescript/components/HLSPlayerControls.d.ts +12 -2
- package/lib/typescript/components/HLSPlayerControls.d.ts.map +1 -1
- package/lib/typescript/components/HLSSeekbackwardControl.d.ts +8 -0
- package/lib/typescript/components/HLSSeekbackwardControl.d.ts.map +1 -0
- package/lib/typescript/components/HLSSeekbar.d.ts +66 -0
- package/lib/typescript/components/HLSSeekbar.d.ts.map +1 -0
- package/lib/typescript/components/HLSSeekforwardControl.d.ts +8 -0
- package/lib/typescript/components/HLSSeekforwardControl.d.ts.map +1 -0
- package/lib/typescript/components/HMSHLSMessage.d.ts.map +1 -1
- package/lib/typescript/components/HMSOverlayMessageView.d.ts +8 -0
- package/lib/typescript/components/HMSOverlayMessageView.d.ts.map +1 -0
- package/lib/typescript/components/Modals.d.ts +3 -3
- package/lib/typescript/components/Modals.d.ts.map +1 -1
- package/lib/typescript/components/Participants/ParticipantsList.d.ts.map +1 -1
- package/lib/typescript/components/Preview.d.ts.map +1 -1
- package/lib/typescript/hooks-util.d.ts +12 -7
- package/lib/typescript/hooks-util.d.ts.map +1 -1
- package/lib/typescript/redux/actionTypes.d.ts +1 -0
- package/lib/typescript/redux/actionTypes.d.ts.map +1 -1
- package/lib/typescript/redux/actions/index.d.ts +6 -0
- package/lib/typescript/redux/actions/index.d.ts.map +1 -1
- package/lib/typescript/redux/index.d.ts +17 -16
- package/lib/typescript/redux/index.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/appState.d.ts +1 -0
- package/lib/typescript/redux/reducers/appState.d.ts.map +1 -1
- package/lib/typescript/redux/reducers/index.d.ts +17 -16
- package/lib/typescript/redux/reducers/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/Icons/Pause/assets/pause-med.png +0 -0
- package/src/Icons/Pause/assets/pause-med@2x.png +0 -0
- package/src/Icons/Pause/assets/pause-med@3x.png +0 -0
- package/src/Icons/Pause/index.tsx +36 -0
- package/src/Icons/Play/assets/play-med.png +0 -0
- package/src/Icons/Play/assets/play-med@2x.png +0 -0
- package/src/Icons/Play/assets/play-med@3x.png +0 -0
- package/src/Icons/Play/index.tsx +36 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow@2x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-backward-arrow@3x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow@2x.png +0 -0
- package/src/Icons/SeekArrow/assets/seek-forward-arrow@3x.png +0 -0
- package/src/Icons/SeekArrow/index.tsx +40 -0
- package/src/Icons/index.ts +3 -0
- package/src/components/HLSChatMessages.tsx +4 -6
- package/src/components/HLSCloseMeetingControl.tsx +39 -0
- package/src/components/HLSClosedCaptionControl.tsx +140 -0
- package/src/components/HLSDistanceFromLive.tsx +69 -0
- package/src/components/HLSFullScreenControl.tsx +46 -0
- package/src/components/HLSGoLiveControl.tsx +104 -0
- package/src/components/HLSPlayPauseControl.tsx +69 -0
- package/src/components/HLSPlayer.tsx +98 -88
- package/src/components/HLSPlayerContainer.tsx +81 -14
- package/src/components/HLSPlayerControls.tsx +137 -58
- package/src/components/HLSSeekbackwardControl.tsx +88 -0
- package/src/components/HLSSeekbar.tsx +381 -0
- package/src/components/HLSSeekforwardControl.tsx +97 -0
- package/src/components/HMSHLSMessage.tsx +32 -49
- package/src/components/HMSHLSMessageList.tsx +2 -2
- package/src/components/HMSOverlayMessageView.tsx +189 -0
- package/src/components/Participants/ParticipantsList.tsx +12 -10
- package/src/hooks-util.ts +39 -1
- package/src/redux/actionTypes.ts +3 -0
- package/src/redux/actions/index.ts +5 -0
- package/src/redux/reducers/appState.ts +8 -0
- package/lib/commonjs/components/CustomHLSPlayerControls.js +0 -80
- package/lib/commonjs/components/CustomHLSPlayerControls.js.map +0 -1
- package/lib/module/components/CustomHLSPlayerControls.js +0 -72
- package/lib/module/components/CustomHLSPlayerControls.js.map +0 -1
- package/lib/typescript/components/CustomHLSPlayerControls.d.ts +0 -7
- package/lib/typescript/components/CustomHLSPlayerControls.d.ts.map +0 -1
- package/src/components/CustomHLSPlayerControls.tsx +0 -92
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import { useDispatch, useSelector } from 'react-redux';
|
|
4
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
5
|
+
import { MaximizeIcon, MinimizeIcon } from '../Icons';
|
|
6
|
+
import { setHlsFullScreen } from '../redux/actions';
|
|
7
|
+
export const _HLSFullScreenControl = ({
|
|
8
|
+
onPress
|
|
9
|
+
}) => {
|
|
10
|
+
const dispatch = useDispatch();
|
|
11
|
+
const hlsFullScreen = useSelector(state => state.app.hlsFullScreen);
|
|
12
|
+
const toggleFullScreen = () => {
|
|
13
|
+
onPress === null || onPress === void 0 || onPress();
|
|
14
|
+
dispatch(setHlsFullScreen(!hlsFullScreen));
|
|
15
|
+
};
|
|
16
|
+
return /*#__PURE__*/React.createElement(GestureDetector, {
|
|
17
|
+
gesture: Gesture.Tap()
|
|
18
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
19
|
+
onPress: toggleFullScreen,
|
|
20
|
+
style: styles.icon
|
|
21
|
+
}, hlsFullScreen ? /*#__PURE__*/React.createElement(MinimizeIcon, {
|
|
22
|
+
size: "medium"
|
|
23
|
+
}) : /*#__PURE__*/React.createElement(MaximizeIcon, {
|
|
24
|
+
size: "medium"
|
|
25
|
+
})));
|
|
26
|
+
};
|
|
27
|
+
export const HLSFullScreenControl = /*#__PURE__*/React.memo(_HLSFullScreenControl);
|
|
28
|
+
const styles = StyleSheet.create({
|
|
29
|
+
icon: {
|
|
30
|
+
padding: 4,
|
|
31
|
+
alignSelf: 'flex-start'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=HLSFullScreenControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","StyleSheet","TouchableOpacity","useDispatch","useSelector","GestureDetector","Gesture","MaximizeIcon","MinimizeIcon","setHlsFullScreen","_HLSFullScreenControl","onPress","dispatch","hlsFullScreen","state","app","toggleFullScreen","createElement","gesture","Tap","style","styles","icon","size","HLSFullScreenControl","memo","create","padding","alignSelf"],"sourceRoot":"../../../src","sources":["components/HLSFullScreenControl.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,gBAAgB,QAAQ,cAAc;AAC3D,SAASC,WAAW,EAAEC,WAAW,QAAQ,aAAa;AACtD,SAASC,eAAe,EAAEC,OAAO,QAAQ,8BAA8B;AAEvE,SAASC,YAAY,EAAEC,YAAY,QAAQ,UAAU;AAErD,SAASC,gBAAgB,QAAQ,kBAAkB;AAMnD,OAAO,MAAMC,qBAA0D,GAAGA,CAAC;EACzEC;AACF,CAAC,KAAK;EACJ,MAAMC,QAAQ,GAAGT,WAAW,CAAC,CAAC;EAC9B,MAAMU,aAAa,GAAGT,WAAW,CAC9BU,KAAgB,IAAKA,KAAK,CAACC,GAAG,CAACF,aAClC,CAAC;EACD,MAAMG,gBAAgB,GAAGA,CAAA,KAAM;IAC7BL,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAG,CAAC;IACXC,QAAQ,CAACH,gBAAgB,CAAC,CAACI,aAAa,CAAC,CAAC;EAC5C,CAAC;EAED,oBACEb,KAAA,CAAAiB,aAAA,CAACZ,eAAe;IAACa,OAAO,EAAEZ,OAAO,CAACa,GAAG,CAAC;EAAE,gBACtCnB,KAAA,CAAAiB,aAAA,CAACf,gBAAgB;IAACS,OAAO,EAAEK,gBAAiB;IAACI,KAAK,EAAEC,MAAM,CAACC;EAAK,GAC7DT,aAAa,gBACZb,KAAA,CAAAiB,aAAA,CAACT,YAAY;IAACe,IAAI,EAAC;EAAQ,CAAE,CAAC,gBAE9BvB,KAAA,CAAAiB,aAAA,CAACV,YAAY;IAACgB,IAAI,EAAC;EAAQ,CAAE,CAEf,CACH,CAAC;AAEtB,CAAC;AAED,OAAO,MAAMC,oBAAoB,gBAAGxB,KAAK,CAACyB,IAAI,CAACf,qBAAqB,CAAC;AAErE,MAAMW,MAAM,GAAGpB,UAAU,CAACyB,MAAM,CAAC;EAC/BJ,IAAI,EAAE;IACJK,OAAO,EAAE,CAAC;IACVC,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, StyleSheet, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import { useSelector } from 'react-redux';
|
|
4
|
+
import { HMSHLSPlaylistType, useIsHLSStreamLive } from '@100mslive/react-native-hms';
|
|
5
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
6
|
+
import { useHMSRoomStyleSheet } from '../hooks-util';
|
|
7
|
+
import { useIsHLSStreamingOn } from '../hooks-sdk';
|
|
8
|
+
export const _HLSGoLiveControl = ({
|
|
9
|
+
playerRef,
|
|
10
|
+
onPress
|
|
11
|
+
}) => {
|
|
12
|
+
const isHLSStreamingOn = useIsHLSStreamingOn();
|
|
13
|
+
const isDVRStream = useSelector(state => {
|
|
14
|
+
var _state$hmsStates$room;
|
|
15
|
+
return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room[0]) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.playlistType) === HMSHLSPlaylistType.DVR;
|
|
16
|
+
});
|
|
17
|
+
const isStreamLive = useIsHLSStreamLive();
|
|
18
|
+
const handleGoLivePress = () => {
|
|
19
|
+
var _playerRef$current;
|
|
20
|
+
onPress === null || onPress === void 0 || onPress();
|
|
21
|
+
(_playerRef$current = playerRef.current) === null || _playerRef$current === void 0 || _playerRef$current.seekToLivePosition();
|
|
22
|
+
};
|
|
23
|
+
const hmsRoomStyles = useHMSRoomStyleSheet((theme, typography) => ({
|
|
24
|
+
semiBoldSurfaceHigh: {
|
|
25
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
26
|
+
color: theme.palette.on_surface_high
|
|
27
|
+
},
|
|
28
|
+
semiBoldSurfaceMedium: {
|
|
29
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
30
|
+
color: theme.palette.on_surface_medium
|
|
31
|
+
},
|
|
32
|
+
liveIndicatorDot: {
|
|
33
|
+
backgroundColor: theme.palette.alert_error_default
|
|
34
|
+
},
|
|
35
|
+
notLiveIndicatorDot: {
|
|
36
|
+
backgroundColor: theme.palette.on_surface_low
|
|
37
|
+
}
|
|
38
|
+
}), []);
|
|
39
|
+
if (!isHLSStreamingOn || !isDVRStream) return null;
|
|
40
|
+
return /*#__PURE__*/React.createElement(GestureDetector, {
|
|
41
|
+
gesture: Gesture.Tap()
|
|
42
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
43
|
+
onPress: handleGoLivePress,
|
|
44
|
+
style: styles.liveButton
|
|
45
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
46
|
+
style: [styles.liveIndicatorDot, isStreamLive ? hmsRoomStyles.liveIndicatorDot : hmsRoomStyles.notLiveIndicatorDot]
|
|
47
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
48
|
+
style: [styles.liveText, isStreamLive ? hmsRoomStyles.semiBoldSurfaceHigh : hmsRoomStyles.semiBoldSurfaceMedium]
|
|
49
|
+
}, isStreamLive ? 'LIVE' : 'GO LIVE')));
|
|
50
|
+
};
|
|
51
|
+
export const HLSGoLiveControl = /*#__PURE__*/React.memo(_HLSGoLiveControl);
|
|
52
|
+
const styles = StyleSheet.create({
|
|
53
|
+
liveButton: {
|
|
54
|
+
padding: 4,
|
|
55
|
+
alignItems: 'center',
|
|
56
|
+
flexDirection: 'row'
|
|
57
|
+
},
|
|
58
|
+
liveIndicatorDot: {
|
|
59
|
+
width: 8,
|
|
60
|
+
height: 8,
|
|
61
|
+
borderRadius: 4,
|
|
62
|
+
marginRight: 8
|
|
63
|
+
},
|
|
64
|
+
liveText: {
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
lineHeight: 24,
|
|
67
|
+
letterSpacing: 0.5
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=HLSGoLiveControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","TouchableOpacity","Text","useSelector","HMSHLSPlaylistType","useIsHLSStreamLive","GestureDetector","Gesture","useHMSRoomStyleSheet","useIsHLSStreamingOn","_HLSGoLiveControl","playerRef","onPress","isHLSStreamingOn","isDVRStream","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","playlistType","DVR","isStreamLive","handleGoLivePress","_playerRef$current","current","seekToLivePosition","hmsRoomStyles","theme","typography","semiBoldSurfaceHigh","fontFamily","font_family","color","palette","on_surface_high","semiBoldSurfaceMedium","on_surface_medium","liveIndicatorDot","backgroundColor","alert_error_default","notLiveIndicatorDot","on_surface_low","createElement","gesture","Tap","style","styles","liveButton","liveText","HLSGoLiveControl","memo","create","padding","alignItems","flexDirection","width","height","borderRadius","marginRight","fontSize","lineHeight","letterSpacing"],"sourceRoot":"../../../src","sources":["components/HLSGoLiveControl.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACvE,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,kBAAkB,EAClBC,kBAAkB,QACb,6BAA6B;AAEpC,SAASC,eAAe,EAAEC,OAAO,QAAQ,8BAA8B;AAEvE,SAASC,oBAAoB,QAAQ,eAAe;AACpD,SAASC,mBAAmB,QAAQ,cAAc;AAQlD,OAAO,MAAMC,iBAAkD,GAAGA,CAAC;EACjEC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,gBAAgB,GAAGJ,mBAAmB,CAAC,CAAC;EAC9C,MAAMK,WAAW,GAAGX,WAAW,CAC5BY,KAAgB;IAAA,IAAAC,qBAAA;IAAA,OACf,EAAAA,qBAAA,GAAAD,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAF,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,iBAAiB,CAACC,QAAQ,cAAAJ,qBAAA,gBAAAA,qBAAA,GAAhDA,qBAAA,CAAmD,CAAC,CAAC,cAAAA,qBAAA,uBAArDA,qBAAA,CAAuDK,YAAY,MACnEjB,kBA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AgB,GAC9BX,aAAa,CAACc,mBAAmB;EACrC,CACH,CAAC,eACF5C,KAAA,CAAA8C,aAAA,CAAC1C,IAAI;IACH6C,KAAK,EAAE,CACLC,MAAM,CAACE,QAAQ,EACf3B,YAAY,GACRK,aAAa,CAACG,mBAAmB,GACjCH,aAAa,CAACS,qBAAqB;EACvC,GAEDd,YAAY,GAAG,MAAM,GAAG,SACrB,CACU,CACH,CAAC;AAEtB,CAAC;AAED,OAAO,MAAM4B,gBAAgB,gBAAGrD,KAAK,CAACsD,IAAI,CAAC1C,iBAAiB,CAAC;AAE7D,MAAMsC,MAAM,GAAGhD,UAAU,CAACqD,MAAM,CAAC;EAC/BJ,UAAU,EAAE;IACVK,OAAO,EAAE,CAAC;IACVC,UAAU,EAAE,QAAQ;IACpBC,aAAa,EAAE;EACjB,CAAC;EACDjB,gBAAgB,EAAE;IAChBkB,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE,CAAC;IACTC,YAAY,EAAE,CAAC;IACfC,WAAW,EAAE;EACf,CAAC;EACDV,QAAQ,EAAE;IACRW,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE;EACjB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { HMSHLSPlaylistType } from '@100mslive/react-native-hms';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { StyleSheet, TouchableOpacity, View } from 'react-native';
|
|
4
|
+
import { useSelector } from 'react-redux';
|
|
5
|
+
import { GestureDetector, Gesture } from 'react-native-gesture-handler';
|
|
6
|
+
import { useIsHLSStreamingOn } from '../hooks-sdk';
|
|
7
|
+
import { PauseIcon, PlayIcon } from '../Icons';
|
|
8
|
+
import { useHLSStreamResumePause } from '../hooks-util';
|
|
9
|
+
const _HLSPlayPauseControl = ({
|
|
10
|
+
playerRef,
|
|
11
|
+
onPress
|
|
12
|
+
}) => {
|
|
13
|
+
const isHLSStreamingOn = useIsHLSStreamingOn();
|
|
14
|
+
const isDVRStream = useSelector(state => {
|
|
15
|
+
var _state$hmsStates$room;
|
|
16
|
+
return ((_state$hmsStates$room = state.hmsStates.room) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) === null || _state$hmsStates$room === void 0 || (_state$hmsStates$room = _state$hmsStates$room[0]) === null || _state$hmsStates$room === void 0 ? void 0 : _state$hmsStates$room.playlistType) === HMSHLSPlaylistType.DVR;
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
isPaused,
|
|
20
|
+
pauseStream,
|
|
21
|
+
resumeStream
|
|
22
|
+
} = useHLSStreamResumePause(playerRef);
|
|
23
|
+
const togglePlayPause = () => {
|
|
24
|
+
onPress === null || onPress === void 0 || onPress();
|
|
25
|
+
if (isPaused) {
|
|
26
|
+
resumeStream();
|
|
27
|
+
} else {
|
|
28
|
+
pauseStream();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
if (!isHLSStreamingOn || !isDVRStream) return null;
|
|
32
|
+
return /*#__PURE__*/React.createElement(GestureDetector, {
|
|
33
|
+
gesture: Gesture.Tap()
|
|
34
|
+
}, /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
35
|
+
onPress: togglePlayPause,
|
|
36
|
+
style: {
|
|
37
|
+
alignSelf: 'center'
|
|
38
|
+
}
|
|
39
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
40
|
+
style: styles.container
|
|
41
|
+
}, isPaused ? /*#__PURE__*/React.createElement(PlayIcon, null) : /*#__PURE__*/React.createElement(PauseIcon, null))));
|
|
42
|
+
};
|
|
43
|
+
export const HLSPlayPauseControl = /*#__PURE__*/React.memo(_HLSPlayPauseControl);
|
|
44
|
+
const styles = StyleSheet.create({
|
|
45
|
+
container: {
|
|
46
|
+
width: 64,
|
|
47
|
+
height: 64,
|
|
48
|
+
borderRadius: 32,
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
backgroundColor: 'rgba(0, 0, 0, 0.6)'
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
//# sourceMappingURL=HLSPlayPauseControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HMSHLSPlaylistType","React","StyleSheet","TouchableOpacity","View","useSelector","GestureDetector","Gesture","useIsHLSStreamingOn","PauseIcon","PlayIcon","useHLSStreamResumePause","_HLSPlayPauseControl","playerRef","onPress","isHLSStreamingOn","isDVRStream","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","playlistType","DVR","isPaused","pauseStream","resumeStream","togglePlayPause","createElement","gesture","Tap","style","alignSelf","styles","container","HLSPlayPauseControl","memo","create","width","height","borderRadius","alignItems","justifyContent","backgroundColor"],"sourceRoot":"../../../src","sources":["components/HLSPlayPauseControl.tsx"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,6BAA6B;AAEhE,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,UAAU,EAAEC,gBAAgB,EAAEC,IAAI,QAAQ,cAAc;AACjE,SAASC,WAAW,QAAQ,aAAa;AACzC,SAASC,eAAe,EAAEC,OAAO,QAAQ,8BAA8B;AAEvE,SAASC,mBAAmB,QAAQ,cAAc;AAElD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,UAAU;AAC9C,SAASC,uBAAuB,QAAQ,eAAe;AAOvD,MAAMC,oBAAwD,GAAGA,CAAC;EAChEC,SAAS;EACTC;AACF,CAAC,KAAK;EACJ,MAAMC,gBAAgB,GAAGP,mBAAmB,CAAC,CAAC;EAC9C,MAAMQ,WAAW,GAAGX,WAAW,CAAEY,KAAgB,IAAK;IAAA,IAAAC,qBAAA;IACpD,OACE,EAAAA,qBAAA,GAAAD,KAAK,CAACE,SAAS,CAACC,IAAI,cAAAF,qBAAA,gBAAAA,qBAAA,GAApBA,qBAAA,CAAsBG,iBAAiB,CAACC,QAAQ,cAAAJ,qBAAA,gBAAAA,qBAAA,GA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,eAAe,EAAE;EACnB;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,87 +1,44 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useSelector } from 'react-redux';
|
|
3
3
|
import { View, Text, StyleSheet, Platform, ActivityIndicator } from 'react-native';
|
|
4
|
-
import { HMSHLSPlayer, HMSHLSPlayerPlaybackState, useHMSHLSPlayerPlaybackState } from '@100mslive/react-native-hms';
|
|
5
|
-
import { changeShowHLSStats } from '../redux/actions';
|
|
6
|
-
import { HLSPlayerStatsView } from './HLSPlayerStatsView';
|
|
4
|
+
import { HMSHLSPlayer, HMSHLSPlayerPlaybackState, useHMSHLSPlayerPlaybackState, useHMSHLSPlayerSubtitles } from '@100mslive/react-native-hms';
|
|
5
|
+
// import { changeShowHLSStats } from '../redux/actions';
|
|
6
|
+
// import { HLSPlayerStatsView } from './HLSPlayerStatsView';
|
|
7
7
|
import { HLSPlayerEmoticons } from './HLSPlayerEmoticons';
|
|
8
|
-
import { CustomControls } from './CustomHLSPlayerControls';
|
|
9
8
|
import { COLORS, hexToRgbA } from '../utils/theme';
|
|
10
9
|
import { HMSHLSNotStarted } from './HMSHLSNotStarted';
|
|
11
10
|
import { CrossCircleIcon } from '../Icons';
|
|
12
|
-
import { useHLSPlayerConstraints, useHMSRoomColorPalette, useHMSRoomStyleSheet } from '../hooks-util';
|
|
11
|
+
import { useHLSPlayerConstraints, useHLSViewsConstraints, useHMSRoomColorPalette, useHMSRoomStyleSheet } from '../hooks-util';
|
|
13
12
|
import { useIsHLSStreamingOn } from '../hooks-sdk';
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import { HMSPinchGesture } from './PeerVideoTile/HMSPinchGesture';
|
|
14
|
+
export const _HLSPlayer = /*#__PURE__*/React.forwardRef((_props, hlsPlayerRef) => {
|
|
15
|
+
// const dispatch = useDispatch();
|
|
16
16
|
const isHLSStreaming = useIsHLSStreamingOn();
|
|
17
17
|
const isStreamUrlPresent = useSelector(state => {
|
|
18
18
|
var _state$hmsStates$room;
|
|
19
19
|
return !!((_state$hmsStates$room = state.hmsStates.room) !== null && _state$hmsStates$room !== void 0 && (_state$hmsStates$room = _state$hmsStates$room.hlsStreamingState.variants) !== null && _state$hmsStates$room !== void 0 && (_state$hmsStates$room = _state$hmsStates$room[0]) !== null && _state$hmsStates$room !== void 0 && _state$hmsStates$room.hlsStreamUrl);
|
|
20
20
|
});
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// const showHLSStats = useSelector(
|
|
22
|
+
// (state: RootState) => state.app.joinConfig.showHLSStats
|
|
23
|
+
// );
|
|
24
|
+
// const showCustomHLSPlayerControls = useSelector(
|
|
25
|
+
// (state: RootState) => state.app.joinConfig.showCustomHLSPlayerControls
|
|
26
|
+
// );
|
|
24
27
|
const enableHLSPlayerControls = useSelector(state => state.app.joinConfig.enableHLSPlayerControls);
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
case 'play':
|
|
31
|
-
{
|
|
32
|
-
var _hmsHlsPlayerRef$curr;
|
|
33
|
-
(_hmsHlsPlayerRef$curr = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr === void 0 || _hmsHlsPlayerRef$curr.play(args[0]);
|
|
34
|
-
break;
|
|
35
|
-
}
|
|
36
|
-
case 'stop':
|
|
37
|
-
{
|
|
38
|
-
var _hmsHlsPlayerRef$curr2;
|
|
39
|
-
(_hmsHlsPlayerRef$curr2 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr2 === void 0 || _hmsHlsPlayerRef$curr2.stop();
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
case 'pause':
|
|
43
|
-
{
|
|
44
|
-
var _hmsHlsPlayerRef$curr3;
|
|
45
|
-
(_hmsHlsPlayerRef$curr3 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr3 === void 0 || _hmsHlsPlayerRef$curr3.pause();
|
|
46
|
-
break;
|
|
47
|
-
}
|
|
48
|
-
case 'resume':
|
|
49
|
-
{
|
|
50
|
-
var _hmsHlsPlayerRef$curr4;
|
|
51
|
-
(_hmsHlsPlayerRef$curr4 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr4 === void 0 || _hmsHlsPlayerRef$curr4.resume();
|
|
52
|
-
break;
|
|
53
|
-
}
|
|
54
|
-
case 'seekForward':
|
|
55
|
-
{
|
|
56
|
-
var _hmsHlsPlayerRef$curr5;
|
|
57
|
-
(_hmsHlsPlayerRef$curr5 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr5 === void 0 || _hmsHlsPlayerRef$curr5.seekForward(args[0]);
|
|
58
|
-
break;
|
|
59
|
-
}
|
|
60
|
-
case 'seekBackward':
|
|
61
|
-
{
|
|
62
|
-
var _hmsHlsPlayerRef$curr6;
|
|
63
|
-
(_hmsHlsPlayerRef$curr6 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr6 === void 0 || _hmsHlsPlayerRef$curr6.seekBackward(args[0]);
|
|
64
|
-
break;
|
|
65
|
-
}
|
|
66
|
-
case 'seekToLive':
|
|
67
|
-
{
|
|
68
|
-
var _hmsHlsPlayerRef$curr7;
|
|
69
|
-
(_hmsHlsPlayerRef$curr7 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr7 === void 0 || _hmsHlsPlayerRef$curr7.seekToLivePosition();
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
|
-
case 'setVolume':
|
|
73
|
-
{
|
|
74
|
-
var _hmsHlsPlayerRef$curr8;
|
|
75
|
-
(_hmsHlsPlayerRef$curr8 = hmsHlsPlayerRef.current) === null || _hmsHlsPlayerRef$curr8 === void 0 || _hmsHlsPlayerRef$curr8.setVolume(args[0]);
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
};
|
|
28
|
+
|
|
29
|
+
// const handleClosePress = () => {
|
|
30
|
+
// dispatch(changeShowHLSStats(false));
|
|
31
|
+
// };
|
|
32
|
+
|
|
80
33
|
const hlsPlayerConstraints = useHLSPlayerConstraints();
|
|
34
|
+
const {
|
|
35
|
+
playerWrapperConstraints
|
|
36
|
+
} = useHLSViewsConstraints();
|
|
81
37
|
const [playerKey, setPlayerKey] = React.useState(1);
|
|
82
38
|
const prevReconnectingRef = React.useRef(null);
|
|
83
39
|
const reconnecting = useSelector(state => state.hmsStates.reconnecting);
|
|
84
40
|
const hlsPlayerPlaybackState = useHMSHLSPlayerPlaybackState();
|
|
41
|
+
const subtitles = useHMSHLSPlayerSubtitles();
|
|
85
42
|
const isPlaybackFailed = hlsPlayerPlaybackState === HMSHLSPlayerPlaybackState.FAILED;
|
|
86
43
|
const isPlayerBuffering = hlsPlayerPlaybackState === HMSHLSPlayerPlaybackState.BUFFERING;
|
|
87
44
|
React.useEffect(() => {
|
|
@@ -108,6 +65,10 @@ export const _HLSPlayer = () => {
|
|
|
108
65
|
warningText: {
|
|
109
66
|
color: theme.palette.alert_warning,
|
|
110
67
|
fontFamily: `${typography.font_family}-SemiBold`
|
|
68
|
+
},
|
|
69
|
+
semiboldWhite: {
|
|
70
|
+
fontFamily: `${typography.font_family}-SemiBold`,
|
|
71
|
+
color: '#ffffff'
|
|
111
72
|
}
|
|
112
73
|
}));
|
|
113
74
|
const {
|
|
@@ -119,20 +80,34 @@ export const _HLSPlayer = () => {
|
|
|
119
80
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
120
81
|
style: [styles.warningSubtitle, hmsRoomStyles.warningText]
|
|
121
82
|
}, "Stream URL not found!"));
|
|
122
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(
|
|
83
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
84
|
+
style: styles.container
|
|
85
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
86
|
+
style: [styles.playerAndCaptionWrapper, {
|
|
87
|
+
width: playerWrapperConstraints.width,
|
|
88
|
+
height: hlsPlayerConstraints.height
|
|
89
|
+
}]
|
|
90
|
+
}, /*#__PURE__*/React.createElement(HMSPinchGesture, null, /*#__PURE__*/React.createElement(View, {
|
|
91
|
+
pointerEvents: "none",
|
|
92
|
+
style: styles.playerContainer
|
|
93
|
+
}, /*#__PURE__*/React.createElement(HMSHLSPlayer, {
|
|
123
94
|
key: playerKey,
|
|
124
|
-
ref:
|
|
125
|
-
enableStats:
|
|
95
|
+
ref: hlsPlayerRef,
|
|
96
|
+
enableStats: true,
|
|
126
97
|
enableControls: enableHLSPlayerControls,
|
|
98
|
+
containerStyle: styles.playerContainer,
|
|
127
99
|
style: {
|
|
128
100
|
width: hlsPlayerConstraints.width,
|
|
129
101
|
height: hlsPlayerConstraints.height
|
|
130
102
|
}
|
|
131
|
-
})
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
103
|
+
}))), /*#__PURE__*/React.createElement(View, {
|
|
104
|
+
style: [{
|
|
105
|
+
width: playerWrapperConstraints.width - 48,
|
|
106
|
+
left: 24
|
|
107
|
+
}, styles.closedCaptionsContainer]
|
|
108
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
109
|
+
style: [styles.closedCaptions, hmsRoomStyles.semiboldWhite]
|
|
110
|
+
}, subtitles)))), /*#__PURE__*/React.createElement(HLSPlayerEmoticons, null), isPlayerBuffering ? /*#__PURE__*/React.createElement(View, {
|
|
136
111
|
style: [styles.playbackFailedContainer, hmsRoomStyles.failedContainer]
|
|
137
112
|
}, /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
138
113
|
size: 'large',
|
|
@@ -142,15 +117,23 @@ export const _HLSPlayer = () => {
|
|
|
142
117
|
}, /*#__PURE__*/React.createElement(CrossCircleIcon, null), /*#__PURE__*/React.createElement(Text, {
|
|
143
118
|
style: [styles.playbackFailed, hmsRoomStyles.failedText]
|
|
144
119
|
}, "Playback Failed")) : null);
|
|
145
|
-
};
|
|
120
|
+
});
|
|
146
121
|
export const HLSPlayer = /*#__PURE__*/React.memo(_HLSPlayer);
|
|
147
122
|
const styles = StyleSheet.create({
|
|
148
|
-
|
|
149
|
-
flex: 1
|
|
123
|
+
container: {
|
|
124
|
+
flex: 1,
|
|
125
|
+
alignItems: 'center',
|
|
126
|
+
justifyContent: 'center'
|
|
150
127
|
},
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
128
|
+
playerAndCaptionWrapper: {
|
|
129
|
+
position: 'relative',
|
|
130
|
+
alignItems: 'center',
|
|
131
|
+
justifyContent: 'center'
|
|
132
|
+
},
|
|
133
|
+
playerContainer: {
|
|
134
|
+
flex: undefined,
|
|
135
|
+
alignItems: 'flex-start',
|
|
136
|
+
justifyContent: 'flex-start'
|
|
154
137
|
},
|
|
155
138
|
textContainer: {
|
|
156
139
|
flex: 1,
|
|
@@ -164,6 +147,25 @@ const styles = StyleSheet.create({
|
|
|
164
147
|
letterSpacing: 0.25,
|
|
165
148
|
textAlign: 'center'
|
|
166
149
|
},
|
|
150
|
+
closedCaptionsContainer: {
|
|
151
|
+
position: 'absolute',
|
|
152
|
+
bottom: 4,
|
|
153
|
+
paddingHorizontal: 8,
|
|
154
|
+
paddingVertical: 4,
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
justifyContent: 'center'
|
|
157
|
+
},
|
|
158
|
+
closedCaptions: {
|
|
159
|
+
fontSize: 14,
|
|
160
|
+
lineHeight: 16,
|
|
161
|
+
textAlign: 'center',
|
|
162
|
+
textShadowColor: 'rgba(0, 0, 0, 0.8)',
|
|
163
|
+
textShadowRadius: 3,
|
|
164
|
+
textShadowOffset: {
|
|
165
|
+
width: 1,
|
|
166
|
+
height: 1
|
|
167
|
+
}
|
|
168
|
+
},
|
|
167
169
|
playbackFailedContainer: {
|
|
168
170
|
flex: 1,
|
|
169
171
|
width: '100%',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","
|
|
1
|
+
{"version":3,"names":["React","useSelector","View","Text","StyleSheet","Platform","ActivityIndicator","HMSHLSPlayer","HMSHLSPlayerPlaybackState","useHMSHLSPlayerPlaybackState","useHMSHLSPlayerSubtitles","HLSPlayerEmoticons","COLORS","hexToRgbA","HMSHLSNotStarted","CrossCircleIcon","useHLSPlayerConstraints","useHLSViewsConstraints","useHMSRoomColorPalette","useHMSRoomStyleSheet","useIsHLSStreamingOn","HMSPinchGesture","_HLSPlayer","forwardRef","_props","hlsPlayerRef","isHLSStreaming","isStreamUrlPresent","state","_state$hmsStates$room","hmsStates","room","hlsStreamingState","variants","hlsStreamUrl","enableHLSPlayerControls","app","joinConfig","hlsPlayerConstraints","playerWrapperConstraints","playerKey","setPlayerKey","useState","prevReconnectingRef","useRef","reconnecting","hlsPlayerPlaybackState","subtitles","isPlaybackFailed","FAILED","isPlayerBuffering","BUFFERING","useEffect","prevReconnecting","current","OS","prevKey","hmsRoomStyles","theme","typography","failedContainer","backgroundColor","palette","background_dim","LOADING_BACKDROP","failedText","color","on_surface_high","fontFamily","font_family","warningText","alert_warning","semiboldWhite","primary_bright","PrimaryBrightColor","createElement","style","styles","textContainer","warningSubtitle","Fragment","container","playerAndCaptionWrapper","width","height","pointerEvents","playerContainer","key","ref","enableStats","enableControls","containerStyle","left","closedCaptionsContainer","closedCaptions","playbackFailedContainer","size","playbackFailed","HLSPlayer","memo","create","flex","alignItems","justifyContent","position","undefined","paddingHorizontal","fontSize","lineHeight","letterSpacing","textAlign","bottom","paddingVertical","textShadowColor","textShadowRadius","textShadowOffset","marginTop"],"sourceRoot":"../../../src","sources":["components/HLSPlayer.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,IAAI,EACJC,IAAI,EACJC,UAAU,EACVC,QAAQ,EACRC,iBAAiB,QACZ,cAAc;AACrB,SACEC,YAAY,EACZC,yBAAyB,EACzBC,4BAA4B,EAC5BC,wBAAwB,QACnB,6BA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AC;EACDP,cAAc,EAAE;IACdU,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE,EAAE;IACdC,aAAa,EAAE,GAAG;IAClBC,SAAS,EAAE,QAAQ;IACnBM,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,20 +1,79 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
|
|
4
|
+
import { Easing, cancelAnimation, useSharedValue, withDelay, withTiming } from 'react-native-reanimated';
|
|
3
5
|
import { useHLSViewsConstraints } from '../hooks-util';
|
|
4
6
|
import { HLSPlayer } from './HLSPlayer';
|
|
5
7
|
import { HLSPlayerControls } from './HLSPlayerControls';
|
|
6
8
|
export const _HLSPlayerContainer = () => {
|
|
7
|
-
|
|
9
|
+
const hlsPlayerRef = React.useRef(null);
|
|
8
10
|
const {
|
|
9
11
|
playerWrapperConstraints
|
|
10
12
|
} = useHLSViewsConstraints();
|
|
11
|
-
|
|
13
|
+
const animatedValue = useSharedValue(1);
|
|
14
|
+
const cancelCurrentControlAnimation = React.useCallback(() => {
|
|
15
|
+
'worklet';
|
|
16
|
+
|
|
17
|
+
cancelAnimation(animatedValue);
|
|
18
|
+
}, []);
|
|
19
|
+
const hideControlsAfterDelay = React.useCallback((duration = 500) => {
|
|
20
|
+
'worklet';
|
|
21
|
+
|
|
22
|
+
animatedValue.value = withDelay(5000, withTiming(0, {
|
|
23
|
+
duration,
|
|
24
|
+
easing: Easing.ease
|
|
25
|
+
}));
|
|
26
|
+
}, []);
|
|
27
|
+
const resetHideControlAnimation = React.useCallback(() => {
|
|
28
|
+
cancelCurrentControlAnimation();
|
|
29
|
+
hideControlsAfterDelay();
|
|
30
|
+
}, [cancelCurrentControlAnimation, hideControlsAfterDelay]);
|
|
31
|
+
const hideControls = React.useCallback((duration = 500) => {
|
|
32
|
+
'worklet';
|
|
33
|
+
|
|
34
|
+
animatedValue.value = withTiming(0, {
|
|
35
|
+
duration,
|
|
36
|
+
easing: Easing.ease
|
|
37
|
+
});
|
|
38
|
+
}, []);
|
|
39
|
+
React.useEffect(() => {
|
|
40
|
+
resetHideControlAnimation();
|
|
41
|
+
}, [resetHideControlAnimation]);
|
|
42
|
+
const tapGesture = React.useMemo(() => {
|
|
43
|
+
return Gesture.Tap().onStart(() => {
|
|
44
|
+
cancelCurrentControlAnimation();
|
|
45
|
+
if (animatedValue.value < 1) {
|
|
46
|
+
animatedValue.value = withTiming(1, {
|
|
47
|
+
duration: 200,
|
|
48
|
+
easing: Easing.ease
|
|
49
|
+
}, finished => {
|
|
50
|
+
if (finished) {
|
|
51
|
+
hideControlsAfterDelay();
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
hideControls(200);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}, [cancelCurrentControlAnimation, hideControls, hideControlsAfterDelay]);
|
|
59
|
+
return /*#__PURE__*/React.createElement(GestureDetector, {
|
|
60
|
+
gesture: tapGesture
|
|
61
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
62
|
+
collapsable: false,
|
|
12
63
|
style: [styles.hlsPlayerContainer, {
|
|
13
64
|
backgroundColor: 'black',
|
|
14
65
|
width: playerWrapperConstraints.width,
|
|
15
66
|
height: playerWrapperConstraints.height
|
|
16
67
|
}]
|
|
17
|
-
}, /*#__PURE__*/React.createElement(HLSPlayer,
|
|
68
|
+
}, /*#__PURE__*/React.createElement(HLSPlayer, {
|
|
69
|
+
ref: hlsPlayerRef
|
|
70
|
+
}), /*#__PURE__*/React.createElement(HLSPlayerControls, {
|
|
71
|
+
playerRef: hlsPlayerRef,
|
|
72
|
+
animatedValue: animatedValue,
|
|
73
|
+
cancelCurrentControlAnimation: cancelCurrentControlAnimation,
|
|
74
|
+
hideControlsAfterDelay: hideControlsAfterDelay,
|
|
75
|
+
resetHideControlAnimation: resetHideControlAnimation
|
|
76
|
+
})));
|
|
18
77
|
};
|
|
19
78
|
export const HLSPlayerContainer = /*#__PURE__*/React.memo(_HLSPlayerContainer);
|
|
20
79
|
const styles = StyleSheet.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","StyleSheet","useHLSViewsConstraints","HLSPlayer","HLSPlayerControls","_HLSPlayerContainer","playerWrapperConstraints","createElement","style","styles","hlsPlayerContainer","backgroundColor","width","height","HLSPlayerContainer","memo","create","hlsView","flex","position","textContainer","paddingHorizontal","alignItems","justifyContent","warningSubtitle","fontSize","lineHeight","letterSpacing","textAlign","playbackFailedContainer","playbackFailed","marginTop"],"sourceRoot":"../../../src","sources":["components/HLSPlayerContainer.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAE/C,SAASC,sBAAsB,QAAQ,eAAe;AACtD,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,iBAAiB,QAAQ,qBAAqB;AAEvD,OAAO,MAAMC,mBAA6B,GAAGA,CAAA,KAAM;EACjD;
|
|
1
|
+
{"version":3,"names":["React","View","StyleSheet","Gesture","GestureDetector","Easing","cancelAnimation","useSharedValue","withDelay","withTiming","useHLSViewsConstraints","HLSPlayer","HLSPlayerControls","_HLSPlayerContainer","hlsPlayerRef","useRef","playerWrapperConstraints","animatedValue","cancelCurrentControlAnimation","useCallback","hideControlsAfterDelay","duration","value","easing","ease","resetHideControlAnimation","hideControls","useEffect","tapGesture","useMemo","Tap","onStart","finished","createElement","gesture","collapsable","style","styles","hlsPlayerContainer","backgroundColor","width","height","ref","playerRef","HLSPlayerContainer","memo","create","hlsView","flex","position","textContainer","paddingHorizontal","alignItems","justifyContent","warningSubtitle","fontSize","lineHeight","letterSpacing","textAlign","playbackFailedContainer","playbackFailed","marginTop"],"sourceRoot":"../../../src","sources":["components/HLSPlayerContainer.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAAS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