Open dxhame opened 8 years ago
@dxhame This body forked branch has fullscreen feature. https://github.com/chinaczy/react-native-media-kit
@KevinOfNeu android平台下播放不了报错,帮我看一下,我代码有错没 是不是我哪写错了
import React, { Component } from 'react'; import { AppRegistry, StyleSheet, TextInput, ListView, TouchableOpacity, Image, ScrollView, Text, Alert, View, Dimensions } from 'react-native'; import {Video} from 'react-native-fullscreen-media-kit';
class Test4 extends Component { fullScreen(){ this.forceUpdate() ; // 横屏强制刷新 }
render() { let width = Dimensions.get('window').width ; let height = width / (16/9) ; let screenStatus = 1 ; let bottomView ; let videoStyle ; if(this.video) //获取手机屏幕方向,0:横屏 screenStatus = this.video.getScreenStatus(); if(screenStatus == 0 ) { videoStyle = {width:width , flex:1} ; }else{ bottomView = (
i am a long string \r\n long \r\n long/n...can change line ?
); videoStyle = {width:width,height:height} ; } //非全屏显示bottomView. return (
<Video style={videoStyle} src={'http://v.yoai.com/femme_tampon_tutorial.mp4'} autoplay={false} preload={'none'} loop={false} controls={true} muted={false} ref={(video)=>this.video = video} screenUpdate={this.fullScreen.bind(this)} poster={'http://static.yoaicdn.com/shoppc/images/cover_img_e1e9e6b.jpg'} videoTitle={"如何使用初密"} /> {bottomView}
); }
}
const styles = StyleSheet.create({ backgroundVideo: { position: 'absolute', top: 0, left: 0, bottom: 0, right: 0, }, container:{ flex:1 } });
export default Test4;
你好,好像没有全屏功能,请问啥时支持? 你有QQ号或者QQ群吗?方便加一下你请教你 @ldn0x7dc