ldn0x7dc / react-native-media-kit

Video(and audio) component for react-native apps, supporting both iOS and Android. A unified and elegant player controller is provided by default. The API is similar with HTML video.
200 stars 70 forks source link

你好,好像没有全屏功能 #24

Open dxhame opened 8 years ago

dxhame commented 8 years ago

你好,好像没有全屏功能,请问啥时支持? 你有QQ号或者QQ群吗?方便加一下你请教你 @ldn0x7dc

KevinOfNeu commented 7 years ago

@dxhame This body forked branch has fullscreen feature. https://github.com/chinaczy/react-native-media-kit

super-ax commented 7 years ago

@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;