Преглед на файлове

add videos + whitespace

David преди 9 години
родител
ревизия
06b91622c0
променени са 3 файла, в които са добавени 18 реда и са изтрити 8 реда
  1. 2 1
      src/scenes/Clase.js
  2. 4 4
      src/scenes/Clase/Teoria.js
  3. 12 3
      src/scenes/LiveVideo.js

+ 2 - 1
src/scenes/Clase.js

@@ -9,6 +9,7 @@ import { Actions } from 'react-native-router-flux';
 import { claseFetch, saveClase, deleteClase } from '../actions/';
 import Teoria from './Clase/Teoria';
 import Comentarios from './Clase/Comentarios';
+import Videos from './Clase/Videos';
 import { Spinner, ConnectionError } from '../components/common/';
 import MyActionButton from '../components/ActionButton';
 
@@ -52,7 +53,7 @@ class Clase extends Component {
 				<Teoria
 					titulo={titulo} profesor={profesor} fecha={fecha} texto={texto} style={{ flex: 1 }} tabLabel='Teoria'
 				/>
-				<View tabLabel='Videos' />
+				<Videos tabLabel='Videos' />
 				<Comentarios
 					style={{ flex: 1 }} comentarios={comentarios}
 					titulo={titulo} profesor={profesor} fecha={fecha}

+ 4 - 4
src/scenes/Clase/Teoria.js

@@ -15,10 +15,10 @@ class Teoria extends Component {
 				<Header titulo={this.props.titulo} profesor={this.props.profesor} fecha={this.props.fecha} />
 		        <CardSection style={{ flex: 1, alignItems: 'stretch' }}>
 		            <WebView
-					  scrollEnabled={false}
-					  onMessage={this.updateWebViewHeight.bind(this)}
-					  automaticallyAdjustContentInsets={true}
-					  style={{ height: this.state.webViewHeight }}
+								  scrollEnabled={false}
+								  onMessage={this.updateWebViewHeight.bind(this)}
+								  automaticallyAdjustContentInsets={true}
+								  style={{ height: this.state.webViewHeight }}
 		              source={{ html: body }} />
 		        </CardSection>
 			</ScrollView>

+ 12 - 3
src/scenes/LiveVideo.js

@@ -5,6 +5,8 @@ import {
 } from 'react-native';
 
 import Video from 'react-native-video';
+import VideoPlayer from 'react-native-video-controls';
+
 import Socket from '../components/Socket';
 import Chat from './Live/Chat';
 
@@ -38,12 +40,19 @@ class LiveVideo extends Component {
 				<ScrollableTabView renderTabBar={() => <View />} >
 					<View tabLabel='Video' style={styles.videoPage}>
 						<View style={styles.video}>
-							<Video
+							<VideoPlayer
 								source={{ uri: 'https://plataforma.especificosba.com.ar/hls/movie.m3u8' }}
 								ref={(ref) => { this.player = ref; }}
-								volume={0.2}
+								volume={1}
 								resizeMode={'contain'}
-								style={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}
+								videoStyle={{ position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }}
+								navigator={ this.props.navigator }
+								rate={ 1 }
+								controlTimeout={ 15000 }
+								resizeMode="cover"
+								playInBackground={true}
+								playWhenInactive={true}
+								
 							/>
 						</View>
 					</View>