update 7 files

master
Reza_ashrafi 2 years ago
parent 412bcc732d
commit e2f0a26ca0
  1. 3
      android/app/src/main/AndroidManifest.xml
  2. 2
      android/build.gradle
  3. 1
      package.json
  4. 8
      src/navigation.js
  5. 138
      src/screens/VideoDisplay/index.js
  6. 26
      yarn.lock

@ -16,7 +16,8 @@
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:launchMode="singleTask" android:launchMode="singleTask"
android:windowSoftInputMode="adjustResize" android:windowSoftInputMode="adjustResize"
android:exported="true"> android:exported="true"
android:screenOrientation="portrait">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />

@ -40,6 +40,7 @@ allprojects {
// Android JSC is installed from npm // Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist") url("$rootDir/../node_modules/jsc-android/dist")
} }
mavenCentral { mavenCentral {
// We don't want to fetch react-native from Maven Central as there are // We don't want to fetch react-native from Maven Central as there are
// older versions over there. // older versions over there.
@ -49,5 +50,6 @@ allprojects {
} }
google() google()
maven { url 'https://www.jitpack.io' } maven { url 'https://www.jitpack.io' }
jcenter()
} }
} }

@ -25,6 +25,7 @@
"react-native-screens": "3.10.2", "react-native-screens": "3.10.2",
"react-native-select-dropdown": "1.13.0", "react-native-select-dropdown": "1.13.0",
"react-native-svg": "^12.3.0", "react-native-svg": "^12.3.0",
"react-native-video": "5.1.1",
"react-redux": "^8.0.2", "react-redux": "^8.0.2",
"redux": "^4.2.0", "redux": "^4.2.0",
"redux-persist": "^6.0.0", "redux-persist": "^6.0.0",

@ -26,7 +26,7 @@ import Product from "../src/screens/Product";
// import Activation from "../src/screens/Activation"; // import Activation from "../src/screens/Activation";
import Videos from '../src/screens/Videos'; import Videos from '../src/screens/Videos';
import Video from "../src/screens/Video"; import Video from "../src/screens/Video";
// import VideoDisplay from "../src/screens/VideoDisplay"; import VideoDisplay from "../src/screens/VideoDisplay";
// import Contact from "../src/screens/Contact"; // import Contact from "../src/screens/Contact";
// import Tests from "../src/screens/Tests"; // import Tests from "../src/screens/Tests";
import ShoppingCart from '../src/screens/ShoppingCart'; import ShoppingCart from '../src/screens/ShoppingCart';
@ -476,8 +476,9 @@ const HomeStackScreen = ({theme, startUserGuide}) => {
<HomeStack.Screen name="VOD" component={Videos} /> <HomeStack.Screen name="VOD" component={Videos} />
<HomeStack.Screen name="Product" component={Product} /> <HomeStack.Screen name="Product" component={Product} />
<HomeStack.Screen name="Video" component={Video} unmountOnExit={true} /> <HomeStack.Screen name="Video" component={Video} unmountOnExit={true} />
{/*
<HomeStack.Screen name="VideoDisplay" component={VideoDisplay} /> <HomeStack.Screen name="VideoDisplay" component={VideoDisplay} />
{/*
<HomeStack.Screen name="Sample" component={Sample} /> <HomeStack.Screen name="Sample" component={Sample} />
<HomeStack.Screen name="Blogs" component={Blogs} /> <HomeStack.Screen name="Blogs" component={Blogs} />
<HomeStack.Screen name="MoreBlog" component={MoreBlog} /> <HomeStack.Screen name="MoreBlog" component={MoreBlog} />
@ -524,8 +525,7 @@ const VODStackScreen = ({theme}) => {
initialRouteName="VOD"> initialRouteName="VOD">
<VODStack.Screen name="VOD" children={() => <Videos />} /> <VODStack.Screen name="VOD" children={() => <Videos />} />
<VODStack.Screen name="Video" component={Video} unmountOnExit={true} /> <VODStack.Screen name="Video" component={Video} unmountOnExit={true} />
{/* <VODStack.Screen name="VideoDisplay" component={VideoDisplay} />
<VODStack.Screen name="VideoDisplay" component={VideoDisplay} /> */}
</VODStack.Navigator> </VODStack.Navigator>
); );
}; };

@ -1,77 +1,74 @@
import React, { useState, useEffect } from "react"; import React, {useState, useEffect} from 'react';
import { import {
View, View,
StyleSheet, StyleSheet,
Dimensions, Dimensions,
ScrollView, ScrollView,
SafeAreaView,
StatusBar, StatusBar,
LayoutAnimation, LayoutAnimation,
Text, Text,
Platform, Platform,
} from "react-native"; } from 'react-native';
import { connect } from "react-redux"; import {SafeAreaView, useSafeAreaInsets} from 'react-native-safe-area-context';
import { publicApi } from "../../redux/actions"; import {connect} from 'react-redux';
import { Video } from "expo-av"; import Video from 'react-native-video';
import * as ScreenOrientation from "expo-screen-orientation";
// import * as ScreenOrientation from 'expo-screen-orientation';
//components //components
import Navbar from "../../components/Navbar"; import Navbar from '../../components/Navbar';
import Drawer from "../../components/Drawer"; import Drawer from '../../components/Drawer';
import Season from "./components/Season"; import Season from './components/Season';
import Divider from "../../components/Divider"; import Divider from '../../components/Divider';
//style //style
import tw from "tailwind-rn"; import tw from 'tailwind-rn';
import fontSize from "../../constants/fontSize"; import fontSize from '../../constants/fontSize';
import Colors from "../../constants/Colors"; import Colors from '../../constants/Colors';
//assets //assets
import posterImage from "../../assets/images/poster.png"; import posterImage from '../../assets/images/poster.png';
const ios = Platform.OS === "ios"; const ios = Platform.OS === 'ios';
function VideoDisplay({ route, mobile, theme }) { function VideoDisplay({route, mobile, theme}) {
const insets = useSafeAreaInsets();
const video = React.useRef(null); const video = React.useRef(null);
const [width, setWidth] = useState(Dimensions.get("window").width); const [width, setWidth] = useState(Dimensions.get('window').width);
const [position, setPosition] = useState("100%"); const [position, setPosition] = useState('100%');
const setBoxPosition = () => { const setBoxPosition = () => {
LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut); LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
setPosition(position === "100%" ? "0%" : "100%"); setPosition(position === '100%' ? '0%' : '100%');
}; };
const onFullscreenUpdate = async ({ fullscreenUpdate }) => { // const onFullscreenUpdate = async ({fullscreenUpdate}) => {
if (fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_DID_PRESENT) { // if (fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_DID_PRESENT) {
await ScreenOrientation.unlockAsync(); // await ScreenOrientation.unlockAsync();
} else if ( // } else if (
fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS // fullscreenUpdate === Video.FULLSCREEN_UPDATE_PLAYER_WILL_DISMISS
) { // ) {
await ScreenOrientation.lockAsync( // await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.PORTRAIT // ScreenOrientation.OrientationLock.PORTRAIT,
); // );
} // }
}; // };
React.useEffect(() => { React.useEffect(() => {
video.current.replayAsync(); // video.current.replayAsync();
video.current.playAsync(); // video.current.playAsync();
}, [route]); }, [route]);
return ( return (
<SafeAreaView <SafeAreaView
style={{ style={{flex: 1, paddingTop: insets.top, paddingBottom: insets.bottom}}>
paddingTop: !ios ? StatusBar.currentHeight : 0,
position: "relative",
}}
>
<Navbar <Navbar
setBoxPosition={setBoxPosition} setBoxPosition={setBoxPosition}
headerOptions={{ headerOptions={{
logo: false, logo: false,
menu: true, menu: true,
hamburgerMenu: false, hamburgerMenu: false,
title: "", title: '',
bookmark: false, bookmark: false,
qr: false, qr: false,
back: true, back: true,
@ -81,61 +78,58 @@ function VideoDisplay({ route, mobile, theme }) {
<ScrollView <ScrollView
contentContainerStyle={styles.contentContainerStyle} contentContainerStyle={styles.contentContainerStyle}
style={styles.container} style={styles.container}
onLayout={() => setWidth(Dimensions.get("window").width)} onLayout={() => setWidth(Dimensions.get('window').width)}>
> {!mobile ? <View style={tw('mt-5')}></View> : null}
{!mobile ? <View style={tw("mt-5")}></View> : null} <View style={tw('flex')}>
<View style={tw("flex ")}>
<Video <Video
source={{
uri: `https://dnvn.ir/api/v1/file/${route.params.unit?.fileIds}`,
}} // Can be a URL or a local file.
ref={video} ref={video}
resizeMode="cover"
fullscreen={true}
fullscreenOrientation='landscape'
// Store reference
onBuffer={() => {}} // Callback when remote video is buffering
onError={() => {}} // Callback when video cannot be loaded
style={{ style={{
width: "100%", width: '100%',
height: (width * 3) / 4.57 - 16, height: (width * 3) / 4.57 - 16,
borderWidth: 1, borderWidth: 1,
borderColor: borderColor:
theme === "light" theme === 'light'
? Colors.theme1.gray2077 + "66" ? Colors.theme1.gray2077 + '66'
: Colors.theme1.white + "55", : Colors.theme1.white + '55',
shadowColor: "#00000055", shadowColor: '#00000055',
shadowOffset: { width: 0, height: 1 }, shadowOffset: {width: 0, height: 1},
shadowOpacity: 0.8, shadowOpacity: 0.8,
shadowRadius: 2, shadowRadius: 2,
elevation: 5, elevation: 5,
zIndex : 100, zIndex: 100,
}}
source={{
uri: `https://dnvn.ir/api/v1/file/${route.params.unit?.fileIds}`,
}}
useNativeControls
resizeMode="cover"
onFullscreenUpdate={onFullscreenUpdate}
usePoster={true}
posterSource={posterImage}
posterStyle={{
width: "100%",
height: "100%",
}} }}
controls
// poster={{ uri : posterImage }}
/> />
<Text <Text
style={{ style={{
fontSize: fontSize.xl, fontSize: fontSize.xl,
fontFamily: "Medium", fontFamily: 'Medium',
marginTop: mobile ? 20 : 12, marginTop: mobile ? 20 : 12,
color: color:
theme === "light" ? Colors.theme1.gray20 : Colors.theme1.white, theme === 'light' ? Colors.theme1.gray20 : Colors.theme1.white,
textAlign: "right", textAlign: 'right',
}} }}>
>
{route.params.unit?.name} {route.params.unit?.name}
</Text> </Text>
<View <View
style={[ style={[
tw("flex flex-1 justify-between"), tw('flex flex-1 justify-between'),
{ {
paddingRight: 10, paddingRight: 10,
}, },
]} ]}>
> <Divider type={'vertical'} />
<Divider type={"vertical"} />
</View> </View>
{route?.params?.videoBuyed ? ( {route?.params?.videoBuyed ? (
<Season <Season
@ -161,7 +155,7 @@ const styles = StyleSheet.create({
}, },
}); });
const mapStateToProps = (state) => ({ const mapStateToProps = state => ({
grades: state.publicApi.grades, grades: state.publicApi.grades,
mobile: state.publicApi.mobile, mobile: state.publicApi.mobile,
theme: state.publicApi.theme, theme: state.publicApi.theme,

@ -2775,6 +2775,11 @@ electron-to-chromium@^1.4.118:
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz#fd20970c3def2f9e6b32ac13a2e7a6b64e1b0c48" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.146.tgz#fd20970c3def2f9e6b32ac13a2e7a6b64e1b0c48"
integrity sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg== integrity sha512-4eWebzDLd+hYLm4csbyMU2EbBnqhwl8Oe9eF/7CBDPWcRxFmqzx4izxvHH+lofQxzieg8UbB8ZuzNTxeukzfTg==
eme-encryption-scheme-polyfill@^2.0.1:
version "2.0.4"
resolved "https://registry.yarnpkg.com/eme-encryption-scheme-polyfill/-/eme-encryption-scheme-polyfill-2.0.4.tgz#7d818302af3f3b19d5974255dcc92dc087413845"
integrity sha512-MHYJX1v145Pjj2YJTrVVuJOYyXrxGVy8LWf6kV5M4jrV/GyoeuJKyTuD+GaD+VAiE8Ip+MptiH4dXk6ZVmMNow==
emittery@^0.10.2: emittery@^0.10.2:
version "0.10.2" version "0.10.2"
resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933" resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.10.2.tgz#902eec8aedb8c41938c46e9385e9db7e03182933"
@ -4627,6 +4632,11 @@ jsonify@~0.0.0:
array-includes "^3.1.4" array-includes "^3.1.4"
object.assign "^4.1.2" object.assign "^4.1.2"
keymirror@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/keymirror/-/keymirror-0.1.1.tgz#918889ea13f8d0a42e7c557250eee713adc95c35"
integrity sha512-vIkZAFWoDijgQT/Nvl2AHCMmnegN2ehgTPYuyy2hWQkQSntI0S7ESYqdLkoSe1HyEBFHHkCgSIvVdSEiWwKvCg==
kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
version "3.2.2" version "3.2.2"
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
@ -5914,6 +5924,15 @@ react-native-svg@^12.3.0:
css-select "^4.2.1" css-select "^4.2.1"
css-tree "^1.0.0-alpha.39" css-tree "^1.0.0-alpha.39"
react-native-video@5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-native-video/-/react-native-video-5.1.1.tgz#89a7989efeb8d404611c06154d1da227a745d7d8"
integrity sha512-zee8gRUrjPWRoZSEBiMebClqu1iAuCQNLjzqpmXFrRWEoJj7azM3BPqLQWJgsnfLiYUYGySeApC/G60THM5+tw==
dependencies:
keymirror "^0.1.1"
prop-types "^15.7.2"
shaka-player "^2.5.9"
react-native@0.68.2: react-native@0.68.2:
version "0.68.2" version "0.68.2"
resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.68.2.tgz#07547cd31bb9335a7fa4135cfbdc24e067142585" resolved "https://registry.yarnpkg.com/react-native/-/react-native-0.68.2.tgz#07547cd31bb9335a7fa4135cfbdc24e067142585"
@ -6388,6 +6407,13 @@ setprototypeof@1.2.0:
resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424"
integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==
shaka-player@^2.5.9:
version "2.5.23"
resolved "https://registry.yarnpkg.com/shaka-player/-/shaka-player-2.5.23.tgz#db92d1c6cf2314f0180a2cec11b0e2f2560336f5"
integrity sha512-3MC9k0OXJGw8AZ4n/ZNCZS2yDxx+3as5KgH6Tx4Q5TRboTBBCu6dYPI5vp1DxKeyU12MBN1Zcbs7AKzXv2EnCg==
dependencies:
eme-encryption-scheme-polyfill "^2.0.1"
shallow-clone@^3.0.0: shallow-clone@^3.0.0:
version "3.0.1" version "3.0.1"
resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3"

Loading…
Cancel
Save