update 7 files

master
Reza_ashrafi 3 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:launchMode="singleTask"
android:windowSoftInputMode="adjustResize"
android:exported="true">
android:exported="true"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

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

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

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

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

Loading…
Cancel
Save