Closed selimonline closed 7 years ago
Please add this prop to your VideoPlayer component
volume={1}
If you could update README.md and open PR it would be great!
Hi @shahen94 , thanks man.. It worked like a magic. I will add PR soon. btw, I am just looking for some other features. not sure... if those are available...
rotate issue.. if user select landscape type video. it works fine. although extra white space at top. but if user select portrait type video.. it looks so weird. white space at left. https://image.prntscr.com/image/E_yCz22MRXe9Hfue8pOwtQ.png
is any play function available?... like user click on a component.. and onPress will have player.start()... something like that
replay={true} , not working always. specially if user don't select trim. video ends and don't replay.
Thanks buddy... I really appropriate your valuable time...
Sorry man but i don't know how to fix it, we never faced with this issue before, maybe you can put some styles to fix it ?
Just wrap VideoPlayer component with Touchable - like this
<TouchableOpacity onPress={() => this.setState({ play: !this.state.play })}>
<VideoPlayer play={this.state.play} />
</TouchableOpacity>
I heard about this issue before and now i believe that it exists. I don't have so much time to work on this issue in these days - Mainly i'll wait help from the community
thanks again.. I fixed all as per my requirements...
for portrait type video, we need to use rotate:true but need to detect a video is portrait or landscape type by videoinfo function
that worked...
if anybody face same issue, when video gets end, just set a function to replay video by setting play :true now, how to track video end, when currentTime and endTime gets same..
Thanks again @shahen94 You can close this issue...
Hi @selimonline, how did you detect whether the video was portrait or not? I'm confused on this part. Thanks!
constructor(props) { super(props); this.state = { video_src:this.props.video_src, //video_src:'file:///var/mobile/Containers/Data/Application/208D2C67-840C-41E5-A2AE-B702B8C20213/tmp/trim.2E928204-EDE2-4F6B-8849-3C7DB2005BAC.MOV', currentTime:0, startTime:0, endTime:-1, limitSecond:7, rotate:false, getSelection:0, playerStyle : styles.videoPlayer_main, trimStyle:'', trimSrc:'', clipsSrc:[] }; }
<VideoPlayer ref={ref => this.videoPlayerRef = ref} startTime={this.state.startTime} endTime={this.state.endTime} play={true} replay={true} playerWidth={screen.width} rotate={this.state.rotate} source={this.state.video_src} style={this.state.playerStyle} resizeMode={VideoPlayer.Constants.resizeMode.CONTAIN} onChange={({ nativeEvent }) => this.setState({currentTime:nativeEvent.currentTime}) } // get Current time on every second onEnd={({ eventDs }) => console.log(eventDs) } // get Current time on every second />