@plusscommunities/pluss-core-app 4.0.4-auth.0 → 6.0.0-auth.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.
- package/dist/module/actions/FollowerActions.js +34 -0
- package/dist/module/actions/FollowerActions.js.map +1 -0
- package/dist/module/actions/MediaActions.js +29 -0
- package/dist/module/actions/MediaActions.js.map +1 -0
- package/dist/module/actions/ResidentActions.js +26 -0
- package/dist/module/actions/ResidentActions.js.map +1 -0
- package/dist/module/actions/UserActions.js +223 -0
- package/dist/module/actions/UserActions.js.map +1 -0
- package/dist/module/actions/UserSettingsActions.js +14 -0
- package/dist/module/actions/UserSettingsActions.js.map +1 -0
- package/dist/module/actions/index.js +6 -0
- package/dist/module/actions/index.js.map +1 -0
- package/dist/module/actions/types.js +17 -0
- package/dist/module/actions/types.js.map +1 -0
- package/dist/module/apis/analyticsActions.js +20 -0
- package/dist/module/apis/analyticsActions.js.map +1 -0
- package/dist/module/apis/contactActions.js +27 -0
- package/dist/module/apis/contactActions.js.map +1 -0
- package/dist/module/apis/eventActions.js +161 -0
- package/dist/module/apis/eventActions.js.map +1 -0
- package/dist/module/apis/fileActions.js +86 -0
- package/dist/module/apis/fileActions.js.map +1 -0
- package/dist/module/apis/followerActions.js +38 -0
- package/dist/module/apis/followerActions.js.map +1 -0
- package/dist/module/apis/index.js +12 -0
- package/dist/module/apis/index.js.map +1 -0
- package/dist/module/apis/notificationActions.js +60 -0
- package/dist/module/apis/notificationActions.js.map +1 -0
- package/dist/module/apis/profileActions.js +14 -0
- package/dist/module/apis/profileActions.js.map +1 -0
- package/dist/module/apis/reactionActions.js +76 -0
- package/dist/module/apis/reactionActions.js.map +1 -0
- package/dist/module/apis/stringActions.js +30 -0
- package/dist/module/apis/stringActions.js.map +1 -0
- package/dist/module/apis/typeActions.js +15 -0
- package/dist/module/apis/typeActions.js.map +1 -0
- package/dist/module/apis/userActions.js +104 -0
- package/dist/module/apis/userActions.js.map +1 -0
- package/dist/module/assets/icons/reactions/heart.png +0 -0
- package/dist/module/assets/icons/reactions/party.png +0 -0
- package/dist/module/assets/icons/reactions/sad.png +0 -0
- package/dist/module/assets/icons/reactions/smile.png +0 -0
- package/dist/module/colours.js +168 -0
- package/dist/module/colours.js.map +1 -0
- package/dist/module/components/AddButton.js +43 -0
- package/dist/module/components/AddButton.js.map +1 -0
- package/dist/module/components/AddToCalendarButton.js +225 -0
- package/dist/module/components/AddToCalendarButton.js.map +1 -0
- package/dist/module/components/Attachment.js +54 -0
- package/dist/module/components/Attachment.js.map +1 -0
- package/dist/module/components/AudienceSelectorLauncher.js +64 -0
- package/dist/module/components/AudienceSelectorLauncher.js.map +1 -0
- package/dist/module/components/AudienceSelectorPage.js +350 -0
- package/dist/module/components/AudienceSelectorPage.js.map +1 -0
- package/dist/module/components/AutoOffsetImage.js +186 -0
- package/dist/module/components/AutoOffsetImage.js.map +1 -0
- package/dist/module/components/BackButton.js +58 -0
- package/dist/module/components/BackButton.js.map +1 -0
- package/dist/module/components/CategoryTabs.js +154 -0
- package/dist/module/components/CategoryTabs.js.map +1 -0
- package/dist/module/components/CommentReply.js +328 -0
- package/dist/module/components/CommentReply.js.map +1 -0
- package/dist/module/components/CommentSection.js +822 -0
- package/dist/module/components/CommentSection.js.map +1 -0
- package/dist/module/components/ConfirmPopup.js +108 -0
- package/dist/module/components/ConfirmPopup.js.map +1 -0
- package/dist/module/components/ConfirmationPopup.js +72 -0
- package/dist/module/components/ConfirmationPopup.js.map +1 -0
- package/dist/module/components/DropDownItem.js +74 -0
- package/dist/module/components/DropDownItem.js.map +1 -0
- package/dist/module/components/DropDownMenu.js +41 -0
- package/dist/module/components/DropDownMenu.js.map +1 -0
- package/dist/module/components/EmptyStateMain.js +50 -0
- package/dist/module/components/EmptyStateMain.js.map +1 -0
- package/dist/module/components/EmptyStateWidget.js +47 -0
- package/dist/module/components/EmptyStateWidget.js.map +1 -0
- package/dist/module/components/FontScaleButton.js +36 -0
- package/dist/module/components/FontScaleButton.js.map +1 -0
- package/dist/module/components/FontScalePopup.js +75 -0
- package/dist/module/components/FontScalePopup.js.map +1 -0
- package/dist/module/components/FormCard.js +25 -0
- package/dist/module/components/FormCard.js.map +1 -0
- package/dist/module/components/FormCardSection.js +212 -0
- package/dist/module/components/FormCardSection.js.map +1 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js +72 -0
- package/dist/module/components/FormCardSectionOptionLauncher.js.map +1 -0
- package/dist/module/components/FormattedText.js +131 -0
- package/dist/module/components/FormattedText.js.map +1 -0
- package/dist/module/components/GenericInput.js +148 -0
- package/dist/module/components/GenericInput.js.map +1 -0
- package/dist/module/components/GenericInputSection.js +158 -0
- package/dist/module/components/GenericInputSection.js.map +1 -0
- package/dist/module/components/Header.js +458 -0
- package/dist/module/components/Header.js.map +1 -0
- package/dist/module/components/ImagePopup.js +240 -0
- package/dist/module/components/ImagePopup.js.map +1 -0
- package/dist/module/components/ImageUploadProgress.js +68 -0
- package/dist/module/components/ImageUploadProgress.js.map +1 -0
- package/dist/module/components/ImageUploader.js +795 -0
- package/dist/module/components/ImageUploader.js.map +1 -0
- package/dist/module/components/InlineButton.js +65 -0
- package/dist/module/components/InlineButton.js.map +1 -0
- package/dist/module/components/Input.js +154 -0
- package/dist/module/components/Input.js.map +1 -0
- package/dist/module/components/LoadingCircles.js +220 -0
- package/dist/module/components/LoadingCircles.js.map +1 -0
- package/dist/module/components/LoadingIndicator.js +86 -0
- package/dist/module/components/LoadingIndicator.js.map +1 -0
- package/dist/module/components/LoadingStateWidget.js +46 -0
- package/dist/module/components/LoadingStateWidget.js.map +1 -0
- package/dist/module/components/MediaPlayer.js +418 -0
- package/dist/module/components/MediaPlayer.js.map +1 -0
- package/dist/module/components/MiddlePopup.js +43 -0
- package/dist/module/components/MiddlePopup.js.map +1 -0
- package/dist/module/components/PDFPopup.js +191 -0
- package/dist/module/components/PDFPopup.js.map +1 -0
- package/dist/module/components/PlussChat.js +986 -0
- package/dist/module/components/PlussChat.js.map +1 -0
- package/dist/module/components/PlussChatMessage.js +262 -0
- package/dist/module/components/PlussChatMessage.js.map +1 -0
- package/dist/module/components/PlussChatTime.js +58 -0
- package/dist/module/components/PlussChatTime.js.map +1 -0
- package/dist/module/components/Popup.js +125 -0
- package/dist/module/components/Popup.js.map +1 -0
- package/dist/module/components/PopupMenu.js +119 -0
- package/dist/module/components/PopupMenu.js.map +1 -0
- package/dist/module/components/PositionedImage.js +313 -0
- package/dist/module/components/PositionedImage.js.map +1 -0
- package/dist/module/components/ProfilePic.js +106 -0
- package/dist/module/components/ProfilePic.js.map +1 -0
- package/dist/module/components/RadioButton.js +77 -0
- package/dist/module/components/RadioButton.js.map +1 -0
- package/dist/module/components/Reaction.js +116 -0
- package/dist/module/components/Reaction.js.map +1 -0
- package/dist/module/components/Reactions.js +71 -0
- package/dist/module/components/Reactions.js.map +1 -0
- package/dist/module/components/SharingTools.js +154 -0
- package/dist/module/components/SharingTools.js.map +1 -0
- package/dist/module/components/Spinner.js +22 -0
- package/dist/module/components/Spinner.js.map +1 -0
- package/dist/module/components/StickyFooter.js +34 -0
- package/dist/module/components/StickyFooter.js.map +1 -0
- package/dist/module/components/TextStyle.js +45 -0
- package/dist/module/components/TextStyle.js.map +1 -0
- package/dist/module/components/Toggle.js +65 -0
- package/dist/module/components/Toggle.js.map +1 -0
- package/dist/module/components/TouchableSearchBar.js +67 -0
- package/dist/module/components/TouchableSearchBar.js.map +1 -0
- package/dist/module/components/UserListPopup.js +135 -0
- package/dist/module/components/UserListPopup.js.map +1 -0
- package/dist/module/components/UserListing.js +267 -0
- package/dist/module/components/UserListing.js.map +1 -0
- package/dist/module/components/VideoPopup.js +113 -0
- package/dist/module/components/VideoPopup.js.map +1 -0
- package/dist/module/components/WarningPopup.js +82 -0
- package/dist/module/components/WarningPopup.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js +289 -0
- package/dist/module/components/expo-image-picker-multiple/ImageBrowser.js.map +1 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js +116 -0
- package/dist/module/components/expo-image-picker-multiple/ImageTile.js.map +1 -0
- package/dist/module/components/index.js +55 -0
- package/dist/module/components/index.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js +385 -0
- package/dist/module/components/react-native-expo-image-cropper/ExpoImageManipulator.js.map +1 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js +387 -0
- package/dist/module/components/react-native-expo-image-cropper/ImageCropOverlay.js.map +1 -0
- package/dist/module/config.js +32 -0
- package/dist/module/config.js.map +1 -0
- package/dist/module/constants.js +19 -0
- package/dist/module/constants.js.map +1 -0
- package/dist/module/fonts/index.js +2 -0
- package/dist/module/fonts/index.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.js +5 -0
- package/dist/module/fonts/pluss60-icons.js.map +1 -0
- package/dist/module/fonts/pluss60-icons.json +1097 -0
- package/dist/module/helper.js +397 -0
- package/dist/module/helper.js.map +1 -0
- package/dist/module/index.js +13 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/js/images/detectFaces.js +30 -0
- package/dist/module/js/images/detectFaces.js.map +1 -0
- package/dist/module/js/images/findLandmarkRange.js +93 -0
- package/dist/module/js/images/findLandmarkRange.js.map +1 -0
- package/dist/module/js/images/getScaledOffset.js +81 -0
- package/dist/module/js/images/getScaledOffset.js.map +1 -0
- package/dist/module/js/site/getSiteLevelFromState.js +29 -0
- package/dist/module/js/site/getSiteLevelFromState.js.map +1 -0
- package/dist/module/js/site/isTVEnabled.js +10 -0
- package/dist/module/js/site/isTVEnabled.js.map +1 -0
- package/dist/module/session.js +58 -0
- package/dist/module/session.js.map +1 -0
- package/dist/module/styles.js +67 -0
- package/dist/module/styles.js.map +1 -0
- package/package.json +20 -24
- package/src/js/images/detectFaces.js +8 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","View","Animated","connect","getMainBrandingColourFromState","LoadingCircles","constructor","args","_defineProperty","animatedSize","Value","animatedOpacity","animatedSize2","animatedOpacity2","animatedSize3","animatedOpacity3","animatedSize4","animatedOpacity4","animatedSize5","animatedOpacity5","componentDidMount","animate","sequence","parallel","timing","state","toValue","duration","useNativeDriver","delay","start","render","createElement","style","styles","container","absolute","circle","borderColor","props","color","colourBrandingMain","width","height","opacity","alignItems","justifyContent","borderRadius","borderWidth","position","top","left","right","bottom","mapStateToProps","loadingCircles"],"sources":["LoadingCircles.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { View, Animated } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getMainBrandingColourFromState } from '../colours';\n\n/* const arr = []\nfor (var i = 0; i < 3; i++) {\n arr.push(i);\n} */\n\nclass LoadingCircles extends Component {\n state = {\n animatedSize: new Animated.Value(1),\n animatedOpacity: new Animated.Value(0),\n animatedSize2: new Animated.Value(1),\n animatedOpacity2: new Animated.Value(0),\n animatedSize3: new Animated.Value(1),\n animatedOpacity3: new Animated.Value(0),\n animatedSize4: new Animated.Value(1),\n animatedOpacity4: new Animated.Value(0),\n animatedSize5: new Animated.Value(1),\n animatedOpacity5: new Animated.Value(0),\n };\n\n /* constructor() {\n super()\n this.state.animatedSizes = [];\n this.state.animatedOpacity = [];\n arr.forEach((value) => {\n this.state.animatedSizes[value] = new Animated.Value(1);\n this.state.animatedOpacity[value] = new Animated.Value(0);\n })\n } */\n\n componentDidMount() {\n this.animate();\n /* setTimeout(() => {\n this.animate2();\n }, 150);\n setTimeout(() => {\n this.animate3();\n }, 300); */\n }\n\n animate() {\n Animated.sequence([\n Animated.parallel([\n Animated.timing(this.state.animatedSize, {\n toValue: 20,\n duration: 900,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity, {\n toValue: 1,\n duration: 900,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize2, {\n toValue: 20,\n duration: 900,\n delay: 150,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity2, {\n toValue: 1,\n duration: 900,\n delay: 150,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize3, {\n toValue: 20,\n duration: 900,\n delay: 300,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity3, {\n toValue: 1,\n duration: 900,\n delay: 400,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize4, {\n toValue: 20,\n duration: 900,\n delay: 450,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity4, {\n toValue: 1,\n duration: 900,\n delay: 450,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize5, {\n toValue: 20,\n duration: 900,\n delay: 600,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity5, {\n toValue: 1,\n duration: 900,\n delay: 600,\n useNativeDriver: false,\n }),\n ]),\n\n Animated.parallel([\n Animated.timing(this.state.animatedOpacity, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity2, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity3, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity4, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedOpacity5, {\n toValue: 0,\n duration: 500,\n useNativeDriver: false,\n }),\n ]),\n\n Animated.parallel([\n Animated.timing(this.state.animatedSize, {\n toValue: 1,\n duration: 1,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize2, {\n toValue: 1,\n duration: 1,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize3, {\n toValue: 1,\n duration: 1,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize4, {\n toValue: 1,\n duration: 1,\n useNativeDriver: false,\n }),\n Animated.timing(this.state.animatedSize5, {\n toValue: 1,\n duration: 1,\n useNativeDriver: false,\n }),\n ]),\n ]).start(() => {\n this.animate();\n });\n }\n\n render() {\n return (\n <View style={styles.container}>\n <View style={[styles.container, styles.absolute]}>\n <Animated.View\n style={[\n styles.circle,\n {\n borderColor: this.props.color || this.props.colourBrandingMain,\n width: this.state.animatedSize,\n height: this.state.animatedSize,\n opacity: this.state.animatedOpacity,\n },\n ]}\n />\n </View>\n <View style={[styles.container, styles.absolute]}>\n <Animated.View\n style={[\n styles.circle,\n {\n borderColor: this.props.color || this.props.colourBrandingMain,\n width: this.state.animatedSize2,\n height: this.state.animatedSize2,\n opacity: this.state.animatedOpacity2,\n },\n ]}\n />\n </View>\n <View style={[styles.container, styles.absolute]}>\n <Animated.View\n style={[\n styles.circle,\n {\n borderColor: this.props.color || this.props.colourBrandingMain,\n width: this.state.animatedSize3,\n height: this.state.animatedSize3,\n opacity: this.state.animatedOpacity3,\n },\n ]}\n />\n </View>\n <View style={[styles.container, styles.absolute]}>\n <Animated.View\n style={[\n styles.circle,\n {\n borderColor: this.props.color || this.props.colourBrandingMain,\n width: this.state.animatedSize4,\n height: this.state.animatedSize4,\n opacity: this.state.animatedOpacity4,\n },\n ]}\n />\n </View>\n <View style={[styles.container, styles.absolute]}>\n <Animated.View\n style={[\n styles.circle,\n {\n borderColor: this.props.color || this.props.colourBrandingMain,\n width: this.state.animatedSize5,\n height: this.state.animatedSize5,\n opacity: this.state.animatedOpacity5,\n },\n ]}\n />\n </View>\n </View>\n );\n }\n}\n\nconst styles = {\n container: {\n width: 30,\n height: 30,\n alignItems: 'center',\n justifyContent: 'center',\n },\n circle: {\n borderRadius: 15,\n borderWidth: 1,\n },\n absolute: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n },\n};\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nconst loadingCircles = connect(mapStateToProps, {})(LoadingCircles);\nexport { loadingCircles as LoadingCircles };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,QAAQ,QAAQ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U,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB,CAAC;EACDT,MAAM,EAAE;IACNU,YAAY,EAAE,EAAE;IAChBC,WAAW,EAAE;EACf,CAAC;EACDZ,QAAQ,EAAE;IACRa,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE,CAAC;IACPC,KAAK,EAAE,CAAC;IACRC,MAAM,EAAE;EACV;AACF,CAAC;AAED,MAAMC,eAAe,GAAG7B,KAAK,IAAI;EAC/B,OAAO;IACLgB,kBAAkB,EAAErC,8BAA8B,CAACqB,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,MAAM8B,cAAc,GAAGpD,OAAO,CAACmD,eAAe,EAAE,CAAC,CAAC,CAAC,CAACjD,cAAc,CAAC;AACnE,SAASkD,cAAc,IAAIlD,cAAc"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
4
|
+
import React, { Component } from 'react';
|
|
5
|
+
import { StyleSheet, Animated, Dimensions } from 'react-native';
|
|
6
|
+
import { connect } from 'react-redux';
|
|
7
|
+
import { getMainBrandingColourFromState } from '../colours';
|
|
8
|
+
const DEFAULT_HEIGHT = 4;
|
|
9
|
+
const DEFAULT_WIDTH = Dimensions.get('window').width;
|
|
10
|
+
class LoadingIndicator extends Component {
|
|
11
|
+
constructor(props) {
|
|
12
|
+
super(props);
|
|
13
|
+
_defineProperty(this, "animate", () => {
|
|
14
|
+
Animated.sequence([Animated.timing(this.state.animatedLeft, {
|
|
15
|
+
toValue: DEFAULT_WIDTH,
|
|
16
|
+
duration: 1500,
|
|
17
|
+
useNativeDriver: false
|
|
18
|
+
}), Animated.delay(500), Animated.timing(this.state.animatedLeft, {
|
|
19
|
+
toValue: -DEFAULT_WIDTH,
|
|
20
|
+
duration: 1500,
|
|
21
|
+
useNativeDriver: false
|
|
22
|
+
}), Animated.delay(500)]).start(() => {
|
|
23
|
+
this.animate();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
this.state = {
|
|
27
|
+
animatedLeft: new Animated.Value(-DEFAULT_WIDTH),
|
|
28
|
+
animatedOpacity: new Animated.Value(0)
|
|
29
|
+
};
|
|
30
|
+
this.height = 0;
|
|
31
|
+
}
|
|
32
|
+
componentDidMount() {
|
|
33
|
+
this.animate();
|
|
34
|
+
}
|
|
35
|
+
getSnapshotBeforeUpdate(prevProps) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
componentDidUpdate(prevProps) {
|
|
39
|
+
if (prevProps.visible !== this.props.visible) {
|
|
40
|
+
Animated.timing(this.state.animatedOpacity, {
|
|
41
|
+
toValue: this.props.visible ? 0.8 : 0,
|
|
42
|
+
duration: 300,
|
|
43
|
+
useNativeDriver: false
|
|
44
|
+
}).start();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
render() {
|
|
48
|
+
return /*#__PURE__*/React.createElement(Animated.View, {
|
|
49
|
+
style: [styles.container, this.props.style, {
|
|
50
|
+
height: DEFAULT_HEIGHT,
|
|
51
|
+
opacity: this.state.animatedOpacity
|
|
52
|
+
}],
|
|
53
|
+
onLayout: this.onLayout
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Animated.View, {
|
|
55
|
+
style: [styles.line, {
|
|
56
|
+
backgroundColor: this.props.colourBrandingMain,
|
|
57
|
+
left: this.state.animatedLeft,
|
|
58
|
+
height: DEFAULT_HEIGHT
|
|
59
|
+
}]
|
|
60
|
+
}));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
container: {
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
justifyContent: 'center',
|
|
67
|
+
overflow: 'hidden',
|
|
68
|
+
backgroundColor: '#fff',
|
|
69
|
+
width: '100%',
|
|
70
|
+
height: 38
|
|
71
|
+
},
|
|
72
|
+
innerContainer: {
|
|
73
|
+
flexDirection: 'row'
|
|
74
|
+
},
|
|
75
|
+
line: {
|
|
76
|
+
width: DEFAULT_WIDTH
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const mapStateToProps = state => {
|
|
80
|
+
return {
|
|
81
|
+
colourBrandingMain: getMainBrandingColourFromState(state)
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
export default connect(mapStateToProps, {})(LoadingIndicator);
|
|
85
|
+
// export { loadingIndicator as Default };
|
|
86
|
+
//# sourceMappingURL=LoadingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Component","StyleSheet","Animated","Dimensions","connect","getMainBrandingColourFromState","DEFAULT_HEIGHT","DEFAULT_WIDTH","get","width","LoadingIndicator","constructor","props","_defineProperty","sequence","timing","state","animatedLeft","toValue","duration","useNativeDriver","delay","start","animate","Value","animatedOpacity","height","componentDidMount","getSnapshotBeforeUpdate","prevProps","componentDidUpdate","visible","render","createElement","View","style","styles","container","opacity","onLayout","line","backgroundColor","colourBrandingMain","left","create","alignItems","justifyContent","overflow","innerContainer","flexDirection","mapStateToProps"],"sources":["LoadingIndicator.js"],"sourcesContent":["import React, { Component } from 'react';\nimport { StyleSheet, Animated, Dimensions } from 'react-native';\nimport { connect } from 'react-redux';\nimport { getMainBrandingColourFromState } from '../colours';\n\nconst DEFAULT_HEIGHT = 4;\nconst DEFAULT_WIDTH = Dimensions.get('window').width;\n\nclass LoadingIndicator extends Component {\n constructor(props) {\n super(props);\n this.state = {\n animatedLeft: new Animated.Value(-DEFAULT_WIDTH),\n animatedOpacity: new Animated.Value(0),\n };\n this.height = 0;\n }\n\n componentDidMount() {\n this.animate();\n }\n\n getSnapshotBeforeUpdate(prevProps) {\n return null;\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.visible !== this.props.visible) {\n Animated.timing(this.state.animatedOpacity, {\n toValue: this.props.visible ? 0.8 : 0,\n duration: 300,\n useNativeDriver: false,\n }).start();\n }\n }\n\n animate = () => {\n Animated.sequence([\n Animated.timing(this.state.animatedLeft, {\n toValue: DEFAULT_WIDTH,\n duration: 1500,\n useNativeDriver: false,\n }),\n Animated.delay(500),\n Animated.timing(this.state.animatedLeft, {\n toValue: -DEFAULT_WIDTH,\n duration: 1500,\n useNativeDriver: false,\n }),\n Animated.delay(500),\n ]).start(() => {\n this.animate();\n });\n };\n\n render() {\n return (\n <Animated.View\n style={[styles.container, this.props.style, { height: DEFAULT_HEIGHT, opacity: this.state.animatedOpacity }]}\n onLayout={this.onLayout}\n >\n <Animated.View\n style={[styles.line, { backgroundColor: this.props.colourBrandingMain, left: this.state.animatedLeft, height: DEFAULT_HEIGHT }]}\n />\n </Animated.View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n justifyContent: 'center',\n overflow: 'hidden',\n backgroundColor: '#fff',\n width: '100%',\n height: 38,\n },\n innerContainer: {\n flexDirection: 'row',\n },\n line: {\n width: DEFAULT_WIDTH,\n },\n});\n\nconst mapStateToProps = state => {\n return {\n colourBrandingMain: getMainBrandingColourFromState(state),\n };\n};\n\nexport default connect(mapStateToProps, {})(LoadingIndicator);\n// export { loadingIndicator as Default };\n"],"mappings":";;;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,UAAU,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AAC/D,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,8BAA8B,QAAQ,YAAY;AAE3D,MAAMC,cAAc,GA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ACL0B,kBAAkB,EAAErC,8BAA8B,CAACW,KAAK;EAC1D,CAAC;AACH,CAAC;AAED,eAAeZ,OAAO,CAAC8C,eAAe,EAAE,CAAC,CAAC,CAAC,CAACxC,gBAAgB,CAAC;AAC7D"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { PureComponent } from 'react';
|
|
2
|
+
import { View, ScrollView, StyleSheet } from 'react-native';
|
|
3
|
+
import { TEXT_BLUEGREY } from '../colours';
|
|
4
|
+
class LoadingStateWidget extends PureComponent {
|
|
5
|
+
renderPlaceHolder(opacity = 1) {
|
|
6
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
7
|
+
style: [styles.item, {
|
|
8
|
+
opacity,
|
|
9
|
+
height: this.props.height - 20
|
|
10
|
+
}]
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
15
|
+
style: [styles.container, this.props.height && {
|
|
16
|
+
height: this.props.height
|
|
17
|
+
}, this.props.style]
|
|
18
|
+
}, /*#__PURE__*/React.createElement(ScrollView, {
|
|
19
|
+
horizontal: true,
|
|
20
|
+
style: styles.itemContainer
|
|
21
|
+
}, this.renderPlaceHolder(0.8), this.renderPlaceHolder(0.6), this.renderPlaceHolder(0.4), this.renderPlaceHolder(0.2)));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
container: {
|
|
26
|
+
borderRadius: 5,
|
|
27
|
+
paddingVertical: 5
|
|
28
|
+
},
|
|
29
|
+
titleText: {
|
|
30
|
+
fontFamily: 'qs-bold',
|
|
31
|
+
fontSize: 16,
|
|
32
|
+
color: TEXT_BLUEGREY
|
|
33
|
+
},
|
|
34
|
+
itemContainer: {
|
|
35
|
+
marginTop: 20
|
|
36
|
+
},
|
|
37
|
+
item: {
|
|
38
|
+
borderRadius: 4,
|
|
39
|
+
width: 97,
|
|
40
|
+
height: 98,
|
|
41
|
+
backgroundColor: '#e6ebef',
|
|
42
|
+
marginRight: 16
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export default LoadingStateWidget;
|
|
46
|
+
//# sourceMappingURL=LoadingStateWidget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","PureComponent","View","ScrollView","StyleSheet","TEXT_BLUEGREY","LoadingStateWidget","renderPlaceHolder","opacity","createElement","style","styles","item","height","props","render","container","horizontal","itemContainer","create","borderRadius","paddingVertical","titleText","fontFamily","fontSize","color","marginTop","width","backgroundColor","marginRight"],"sources":["LoadingStateWidget.js"],"sourcesContent":["import React, { PureComponent } from 'react';\nimport { View, ScrollView, StyleSheet } from 'react-native';\nimport { TEXT_BLUEGREY } from '../colours';\n\nclass LoadingStateWidget extends PureComponent {\n renderPlaceHolder(opacity = 1) {\n return <View style={[styles.item, { opacity, height: this.props.height - 20 }]} />;\n }\n\n render() {\n return (\n <View style={[styles.container, this.props.height && { height: this.props.height }, this.props.style]}>\n <ScrollView horizontal style={styles.itemContainer}>\n {this.renderPlaceHolder(0.8)}\n {this.renderPlaceHolder(0.6)}\n {this.renderPlaceHolder(0.4)}\n {this.renderPlaceHolder(0.2)}\n </ScrollView>\n </View>\n );\n }\n}\n\nconst styles = StyleSheet.create({\n container: {\n borderRadius: 5,\n paddingVertical: 5,\n },\n titleText: {\n fontFamily: 'qs-bold',\n fontSize: 16,\n color: TEXT_BLUEGREY,\n },\n itemContainer: {\n marginTop: 20,\n },\n item: {\n borderRadius: 4,\n width: 97,\n height: 98,\n backgroundColor: '#e6ebef',\n marginRight: 16,\n },\n});\n\nexport default LoadingStateWidget;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,QAAQ,OAAO;AAC5C,SAASC,IAAI,EAAEC,UAAU,EAAEC,UAAU,QAAQ,cAAc;AAC3D,SAASC,aAAa,QAAQ,YAAY;AAE1C,MAAMC,kBAAkB,SAASL,aAAa,CAAC;EAC7CM,iBAAiBA,CAACC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
@@ -0,0 +1,418 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
5
|
+
import React, { Component } from 'react';
|
|
6
|
+
import { Platform, View, StyleSheet, Dimensions } from 'react-native';
|
|
7
|
+
import * as ScreenOrientation from 'expo-screen-orientation';
|
|
8
|
+
import { DeviceMotion } from 'expo-sensors';
|
|
9
|
+
import YoutubePlayer, { getYoutubeMeta } from 'react-native-youtube-iframe';
|
|
10
|
+
import { Vimeo } from 'react-native-vimeo-iframe';
|
|
11
|
+
import { WebView } from 'react-native-webview';
|
|
12
|
+
import { Video } from 'expo-av';
|
|
13
|
+
import VideoPlayer from 'expo-video-player';
|
|
14
|
+
import { Spinner } from './Spinner';
|
|
15
|
+
const SCREEN_HEIGHT = Dimensions.get('window').height;
|
|
16
|
+
const SCREEN_WIDTH = Dimensions.get('window').width;
|
|
17
|
+
const EXPO_VIDEO_PROPS = {
|
|
18
|
+
rate: 1,
|
|
19
|
+
isMuted: false,
|
|
20
|
+
volume: 1
|
|
21
|
+
};
|
|
22
|
+
const RETRY_RECOVER = 30000;
|
|
23
|
+
const RETRY_LOADING = 10000;
|
|
24
|
+
class MediaPlayer extends Component {
|
|
25
|
+
constructor(props) {
|
|
26
|
+
super(props);
|
|
27
|
+
_defineProperty(this, "componentDidMount", async () => {
|
|
28
|
+
await this.setupForPlaying();
|
|
29
|
+
ScreenOrientation.lockAsync(Platform.OS === 'ios' ? ScreenOrientation.OrientationLock.DEFAULT : ScreenOrientation.OrientationLock.ALL);
|
|
30
|
+
const motionAvailalble = await DeviceMotion.isAvailableAsync();
|
|
31
|
+
// console.log('motionAvailalble', motionAvailalble);
|
|
32
|
+
if (motionAvailalble) {
|
|
33
|
+
DeviceMotion.setUpdateInterval(500);
|
|
34
|
+
DeviceMotion.addListener(this.onMotionChange);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
_defineProperty(this, "componentWillUnmount", () => {
|
|
38
|
+
if (this.checkStreamLoaded) clearInterval(this.checkStreamLoaded);
|
|
39
|
+
DeviceMotion.removeAllListeners();
|
|
40
|
+
ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP);
|
|
41
|
+
});
|
|
42
|
+
_defineProperty(this, "getYoutubeVideoId", url => {
|
|
43
|
+
url = url.replace(/(>|<)/gi, '').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
|
|
44
|
+
if (url[2] !== undefined) {
|
|
45
|
+
const ids = url[2].split(/[^0-9a-z_\-]/i);
|
|
46
|
+
return ids[0];
|
|
47
|
+
} else {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
_defineProperty(this, "getVimeoId", url => {
|
|
52
|
+
const result = url.match(/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i);
|
|
53
|
+
return result[1];
|
|
54
|
+
});
|
|
55
|
+
_defineProperty(this, "setupForPlaying", async () => {
|
|
56
|
+
// Extract live stream info
|
|
57
|
+
const {
|
|
58
|
+
source,
|
|
59
|
+
useVideoPlayer
|
|
60
|
+
} = this.props;
|
|
61
|
+
const isUrlLink = source && source.startsWith('http');
|
|
62
|
+
const isYoutube = source && (source.includes('youtube.com/watch?v=') || source.includes('youtu.be/'));
|
|
63
|
+
const isVimeo = source && source.includes('vimeo.com/');
|
|
64
|
+
let heightFactor = 0;
|
|
65
|
+
if (isYoutube) {
|
|
66
|
+
const metadata = await getYoutubeMeta(this.getYoutubeVideoId(source));
|
|
67
|
+
heightFactor = metadata.height / metadata.width;
|
|
68
|
+
} else if (useVideoPlayer) {
|
|
69
|
+
heightFactor = 0;
|
|
70
|
+
} else {
|
|
71
|
+
heightFactor = 0.565;
|
|
72
|
+
}
|
|
73
|
+
this.setState({
|
|
74
|
+
isUrlLink,
|
|
75
|
+
isYoutube,
|
|
76
|
+
isVimeo,
|
|
77
|
+
playbackLoaded: isYoutube || isVimeo,
|
|
78
|
+
heightFactor,
|
|
79
|
+
readyToRender: true
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
_defineProperty(this, "getStreamPlaybackUrl", () => {
|
|
83
|
+
// return 'https://stream.mux.com/Ym4nKktRpGuZNBBBlzhxpyRwZLpvMlPRchcu01x6Ur600.m3u8';
|
|
84
|
+
return `https://stream.mux.com/${this.props.playbackId}.m3u8`;
|
|
85
|
+
});
|
|
86
|
+
_defineProperty(this, "checkReloadStream", (wait = RETRY_LOADING, force = false) => {
|
|
87
|
+
if (!force && this.retryLoading) return;
|
|
88
|
+
console.log(`Check loading in ${wait} milliseconds...`);
|
|
89
|
+
this.retryLoading = true;
|
|
90
|
+
setTimeout(async () => {
|
|
91
|
+
const {
|
|
92
|
+
playbackLoaded,
|
|
93
|
+
playbackBuffering
|
|
94
|
+
} = this.state;
|
|
95
|
+
try {
|
|
96
|
+
if (playbackLoaded === false || playbackBuffering === true) {
|
|
97
|
+
console.log('Reloading started');
|
|
98
|
+
await this.videoPlayer.loadAsync({
|
|
99
|
+
uri: this.getStreamPlaybackUrl(),
|
|
100
|
+
overrideFileExtensionAndroid: 'm3u8'
|
|
101
|
+
}, EXPO_VIDEO_PROPS, false);
|
|
102
|
+
} else {
|
|
103
|
+
console.log('Already loaded - not reloading');
|
|
104
|
+
}
|
|
105
|
+
this.retryLoading = false;
|
|
106
|
+
} catch {}
|
|
107
|
+
}, wait);
|
|
108
|
+
});
|
|
109
|
+
_defineProperty(this, "isLandscape", deviceRotation => {
|
|
110
|
+
const {
|
|
111
|
+
beta,
|
|
112
|
+
gamma
|
|
113
|
+
} = deviceRotation;
|
|
114
|
+
const absGamma = Math.abs(gamma);
|
|
115
|
+
const absBeta = Math.abs(beta);
|
|
116
|
+
const isGammaNegative = Math.sign(gamma) === -1;
|
|
117
|
+
if (absGamma <= 0.04 && absBeta <= 0.24) {
|
|
118
|
+
//Portrait mode, on a flat surface.
|
|
119
|
+
return false;
|
|
120
|
+
} else if ((absGamma <= 1.0 || absGamma >= 2.3) && absBeta >= 0.5) {
|
|
121
|
+
//General Portrait mode, accounting for forward and back tilt on the top of the phone.
|
|
122
|
+
return false;
|
|
123
|
+
} else {
|
|
124
|
+
if (isGammaNegative) {
|
|
125
|
+
//Landscape mode with the top of the phone to the left.
|
|
126
|
+
return true;
|
|
127
|
+
} else {
|
|
128
|
+
//Landscape mode with the top of the phone to the right.
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
_defineProperty(this, "onMotionChange", async changeEvent => {
|
|
134
|
+
const deviceRotation = changeEvent.rotation;
|
|
135
|
+
const deviceOrientation = changeEvent.orientation;
|
|
136
|
+
const isLandscape = this.isLandscape(deviceRotation);
|
|
137
|
+
this.orientationQueue.push(isLandscape);
|
|
138
|
+
if (this.orientationQueue.length > 2) this.orientationQueue = this.orientationQueue.slice(-2);
|
|
139
|
+
// console.log('onMotionChange - orientationQueue', this.orientationQueue);
|
|
140
|
+
if (isLandscape !== this.state.isLandscape && isLandscape === (Math.abs(deviceOrientation) === 90) && this.orientationQueue.every(i => i === isLandscape)) {
|
|
141
|
+
this.setState({
|
|
142
|
+
isLandscape
|
|
143
|
+
}, () => {
|
|
144
|
+
// console.log('isLandscape', this.state.isLandscape);
|
|
145
|
+
if (this.props.orientationChanged) this.props.orientationChanged(this.state.isLandscape);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
_defineProperty(this, "onStreamLoadStart", () => {
|
|
150
|
+
console.log('Stream load started');
|
|
151
|
+
this.checkStreamLoaded = setInterval(() => {
|
|
152
|
+
const {
|
|
153
|
+
playbackLoaded
|
|
154
|
+
} = this.state;
|
|
155
|
+
if (playbackLoaded === false) {
|
|
156
|
+
console.log('Stream loading failed unexpectedly');
|
|
157
|
+
this.checkReloadStream(1000, true);
|
|
158
|
+
} else {
|
|
159
|
+
clearInterval(this.checkStreamLoaded);
|
|
160
|
+
}
|
|
161
|
+
}, RETRY_RECOVER);
|
|
162
|
+
});
|
|
163
|
+
_defineProperty(this, "onStreamLoaded", status => {
|
|
164
|
+
console.log(`Stream loaded - isLoaded:${status.isLoaded}, isBuffering:${status.isBuffering}, isPlaying:${status.isPlaying}`);
|
|
165
|
+
});
|
|
166
|
+
_defineProperty(this, "onStreamError", error => {
|
|
167
|
+
console.log('Stream error', error);
|
|
168
|
+
});
|
|
169
|
+
_defineProperty(this, "onStreamStatusUpdate", status => {
|
|
170
|
+
this.setState({
|
|
171
|
+
playbackLoaded: status.isLoaded,
|
|
172
|
+
playbackBuffering: status.isBuffering,
|
|
173
|
+
playbackPlaying: status.isPlaying
|
|
174
|
+
}, () => {
|
|
175
|
+
const {
|
|
176
|
+
playbackLoaded,
|
|
177
|
+
playbackBuffering,
|
|
178
|
+
playbackPlaying,
|
|
179
|
+
shouldPlay
|
|
180
|
+
} = this.state;
|
|
181
|
+
// console.log(`Status updated - isLoaded:${playbackLoaded}, isBuffering:${playbackBuffering}, isPlaying:${playbackPlaying}`);
|
|
182
|
+
if (playbackLoaded === false && playbackBuffering === undefined && playbackPlaying === undefined) {
|
|
183
|
+
this.checkReloadStream();
|
|
184
|
+
} else if (playbackLoaded === true && playbackBuffering === true) {
|
|
185
|
+
this.checkReloadStream(RETRY_RECOVER);
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
_defineProperty(this, "onYoutubeError", e => {
|
|
190
|
+
// console.log('onYoutubeError', e);
|
|
191
|
+
this.setState({
|
|
192
|
+
forceWebview: true
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
_defineProperty(this, "onYoutubeReady", () => {
|
|
196
|
+
// console.log('onYoutubeReady');
|
|
197
|
+
});
|
|
198
|
+
_defineProperty(this, "onVideoPlayStatusUpdate", status => {
|
|
199
|
+
// console.log('onVideoPlayStatusUpdate', status);
|
|
200
|
+
});
|
|
201
|
+
_defineProperty(this, "onVideoPlayError", error => {
|
|
202
|
+
if (error && error.type === 'NonFatal') {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// console.log('onVideoPlayError', error);
|
|
206
|
+
this.setState({
|
|
207
|
+
forceWebview: true
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
_defineProperty(this, "getYoutubePlayer", (youtubeId, width, height, autoPlay) => /*#__PURE__*/React.createElement(YoutubePlayer, {
|
|
211
|
+
ref: ref => this.youtubePlayer = ref,
|
|
212
|
+
height: height,
|
|
213
|
+
width: width,
|
|
214
|
+
videoId: youtubeId,
|
|
215
|
+
play: autoPlay
|
|
216
|
+
// onChangeState={event => console.log('onChangeState', event)}
|
|
217
|
+
,
|
|
218
|
+
onReady: this.onYoutubeReady,
|
|
219
|
+
onError: this.onYoutubeError
|
|
220
|
+
// onPlaybackQualityChange={q => console.log('onPlaybackQualityChange', q)}
|
|
221
|
+
,
|
|
222
|
+
volume: 50,
|
|
223
|
+
playbackRate: 1,
|
|
224
|
+
playerParams: {
|
|
225
|
+
cc_lang_pref: 'us',
|
|
226
|
+
showClosedCaptions: true
|
|
227
|
+
}
|
|
228
|
+
}));
|
|
229
|
+
_defineProperty(this, "getVimeoPlayer", (vimeoId, width, height, autoPlay) => /*#__PURE__*/React.createElement(View, {
|
|
230
|
+
style: {
|
|
231
|
+
width,
|
|
232
|
+
height
|
|
233
|
+
}
|
|
234
|
+
}, /*#__PURE__*/React.createElement(Vimeo, {
|
|
235
|
+
style: {
|
|
236
|
+
marginLeft: -8,
|
|
237
|
+
marginRight: -5
|
|
238
|
+
},
|
|
239
|
+
videoId: vimeoId
|
|
240
|
+
// onReady={() => console.log('Video is ready')}
|
|
241
|
+
// onPlay={() => console.log('Video is playing')}
|
|
242
|
+
// onPlayProgress={data => console.log('Video progress data:', data)}
|
|
243
|
+
// onFinish={() => console.log('Video is finished')}
|
|
244
|
+
,
|
|
245
|
+
loop: false,
|
|
246
|
+
autoPlay: autoPlay,
|
|
247
|
+
controls: true,
|
|
248
|
+
speed: true,
|
|
249
|
+
time: '0m0s'
|
|
250
|
+
})));
|
|
251
|
+
_defineProperty(this, "getWebviewPlayer", (embedUrl, width, height) => /*#__PURE__*/React.createElement(WebView, {
|
|
252
|
+
startInLoadingState: true,
|
|
253
|
+
javaScriptEnabled: true,
|
|
254
|
+
scrollEnabled: false,
|
|
255
|
+
automaticallyAdjustContentInsets: false,
|
|
256
|
+
mediaPlaybackRequiresUserAction: true,
|
|
257
|
+
style: [styles.webView, {
|
|
258
|
+
width,
|
|
259
|
+
height
|
|
260
|
+
}],
|
|
261
|
+
source: {
|
|
262
|
+
uri: embedUrl
|
|
263
|
+
}
|
|
264
|
+
}));
|
|
265
|
+
_defineProperty(this, "getStreamPlayer", (embedUrl, width, height, autoPlay) => /*#__PURE__*/React.createElement(Video, _extends({
|
|
266
|
+
ref: vp => {
|
|
267
|
+
this.videoPlayer = vp;
|
|
268
|
+
},
|
|
269
|
+
source: {
|
|
270
|
+
uri: embedUrl
|
|
271
|
+
}
|
|
272
|
+
}, EXPO_VIDEO_PROPS, {
|
|
273
|
+
shouldPlay: autoPlay,
|
|
274
|
+
resizeMode: Video.RESIZE_MODE_CONTAIN,
|
|
275
|
+
useNativeControls: true,
|
|
276
|
+
style: {
|
|
277
|
+
width,
|
|
278
|
+
height
|
|
279
|
+
},
|
|
280
|
+
onLoadStart: this.onStreamLoadStart,
|
|
281
|
+
onLoad: this.onStreamLoaded,
|
|
282
|
+
onError: this.onStreamError,
|
|
283
|
+
onPlaybackStatusUpdate: this.onStreamStatusUpdate
|
|
284
|
+
})));
|
|
285
|
+
_defineProperty(this, "getVideoPlayer", (embedUrl, width, height, autoPlay) => /*#__PURE__*/React.createElement(VideoPlayer, {
|
|
286
|
+
videoProps: {
|
|
287
|
+
shouldPlay: autoPlay,
|
|
288
|
+
resizeMode: Video.RESIZE_MODE_CONTAIN,
|
|
289
|
+
source: {
|
|
290
|
+
uri: embedUrl
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
showFullscreenButton: false,
|
|
294
|
+
errorCallback: this.onVideoPlayError,
|
|
295
|
+
playbackCallback: this.onVideoPlayStatusUpdate,
|
|
296
|
+
height: height,
|
|
297
|
+
width: width
|
|
298
|
+
}));
|
|
299
|
+
this.state = {
|
|
300
|
+
deviceOrientation: null,
|
|
301
|
+
isLandscape: false,
|
|
302
|
+
isUrlLink: true,
|
|
303
|
+
isYoutube: false,
|
|
304
|
+
isVimeo: false,
|
|
305
|
+
forceWebview: false,
|
|
306
|
+
heightFactor: 0,
|
|
307
|
+
playbackLoaded: false,
|
|
308
|
+
playbackBuffering: false,
|
|
309
|
+
playbackPlaying: false,
|
|
310
|
+
readyToRender: false
|
|
311
|
+
};
|
|
312
|
+
this.youtubePlayer = null;
|
|
313
|
+
this.videoPlayer = null;
|
|
314
|
+
this.checkStreamLoaded = null;
|
|
315
|
+
this.retryLoading = false;
|
|
316
|
+
this.orientationQueue = [];
|
|
317
|
+
}
|
|
318
|
+
render() {
|
|
319
|
+
let width, height;
|
|
320
|
+
const {
|
|
321
|
+
playbackId,
|
|
322
|
+
source,
|
|
323
|
+
autoPlay,
|
|
324
|
+
useVideoPlayer
|
|
325
|
+
} = this.props;
|
|
326
|
+
const {
|
|
327
|
+
readyToRender,
|
|
328
|
+
isLandscape,
|
|
329
|
+
heightFactor,
|
|
330
|
+
isUrlLink,
|
|
331
|
+
isYoutube,
|
|
332
|
+
isVimeo,
|
|
333
|
+
forceWebview,
|
|
334
|
+
playbackLoaded,
|
|
335
|
+
playbackBuffering
|
|
336
|
+
} = this.state;
|
|
337
|
+
if (!readyToRender) return null;
|
|
338
|
+
if (isLandscape) {
|
|
339
|
+
width = SCREEN_HEIGHT;
|
|
340
|
+
height = SCREEN_WIDTH;
|
|
341
|
+
} else {
|
|
342
|
+
width = SCREEN_WIDTH;
|
|
343
|
+
height = heightFactor ? SCREEN_WIDTH * heightFactor : SCREEN_HEIGHT;
|
|
344
|
+
}
|
|
345
|
+
let embedUrl, player, showLoading;
|
|
346
|
+
if (!forceWebview) {
|
|
347
|
+
if (isYoutube) {
|
|
348
|
+
const youtubeId = this.getYoutubeVideoId(source);
|
|
349
|
+
embedUrl = youtubeId ? `https://www.youtube.com/embed/${youtubeId}` : source;
|
|
350
|
+
// console.log('getYoutubePlayer', youtubeId, width, height, autoPlay);
|
|
351
|
+
player = this.getYoutubePlayer(youtubeId, width, height, autoPlay);
|
|
352
|
+
} else if (isVimeo) {
|
|
353
|
+
const vimeoId = this.getVimeoId(source);
|
|
354
|
+
embedUrl = source;
|
|
355
|
+
// console.log('getVimeoPlayer', vimeoId, width, height, autoPlay);
|
|
356
|
+
player = this.getVimeoPlayer(vimeoId, width, height, autoPlay);
|
|
357
|
+
} else if (playbackId) {
|
|
358
|
+
embedUrl = this.getStreamPlaybackUrl();
|
|
359
|
+
// console.log('getStreamPlayer', embedUrl, width, height, autoPlay);
|
|
360
|
+
player = this.getStreamPlayer(embedUrl, width, height, autoPlay);
|
|
361
|
+
showLoading = true;
|
|
362
|
+
} else if (useVideoPlayer) {
|
|
363
|
+
embedUrl = source;
|
|
364
|
+
// console.log('getVideoPlayer', embedUrl, width, height, autoPlay);
|
|
365
|
+
player = this.getVideoPlayer(embedUrl, width, height, autoPlay);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
if (!player && isUrlLink) {
|
|
369
|
+
embedUrl = source;
|
|
370
|
+
console.log('getWebviewPlayer', embedUrl, width, height);
|
|
371
|
+
player = this.getWebviewPlayer(embedUrl, width, height);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// console.log({
|
|
375
|
+
// Streaming: embedUrl,
|
|
376
|
+
// Landscape: isLandscape,
|
|
377
|
+
// Loaded: playbackLoaded,
|
|
378
|
+
// Buffering: playbackBuffering,
|
|
379
|
+
// LoadingIndicator: showLoading,
|
|
380
|
+
// Width: width,
|
|
381
|
+
// Height: height,
|
|
382
|
+
// HeightFactor: heightFactor,
|
|
383
|
+
// isYoutube,
|
|
384
|
+
// isVimeo,
|
|
385
|
+
// playbackId,
|
|
386
|
+
// useVideoPlayer,
|
|
387
|
+
// });
|
|
388
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
389
|
+
style: styles.container
|
|
390
|
+
}, player, showLoading && (!playbackLoaded || playbackBuffering) && /*#__PURE__*/React.createElement(View, {
|
|
391
|
+
style: styles.loadingContainer
|
|
392
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
393
|
+
color: '#fff'
|
|
394
|
+
})));
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
const styles = StyleSheet.create({
|
|
398
|
+
container: {
|
|
399
|
+
flex: 1,
|
|
400
|
+
backgroundColor: '#000',
|
|
401
|
+
alignItems: 'center',
|
|
402
|
+
justifyContent: 'center'
|
|
403
|
+
},
|
|
404
|
+
webView: {
|
|
405
|
+
flex: 1
|
|
406
|
+
},
|
|
407
|
+
loadingContainer: {
|
|
408
|
+
position: 'absolute',
|
|
409
|
+
top: 50,
|
|
410
|
+
left: 0,
|
|
411
|
+
right: 0,
|
|
412
|
+
bottom: 50,
|
|
413
|
+
justifyContent: 'center',
|
|
414
|
+
alignItems: 'center'
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
export default MediaPlayer;
|
|
418
|
+
//# sourceMappingURL=MediaPlayer.js.map
|