Closed dip77 closed 6 years ago
@dip77 Thanks for the pull request. What does this code do?
so in full screen mode video plays from beginning instead of current duration. this bug is solved in this PR
Note to newbies:
1) onProgress(event) is an existing function in your index.js, not a new function.
2) It should be this.setState({currentTime:event.duration })
, not this.setState({currentTime:event.duration
)}
3) public static int duration; should be written inside public class BridgeModule extends ReactContextBaseJavaModule{
Anyway, this update is not working for me. Got error : expected dynamic type 'double' but had type 'null' (constructing arguments for BridgeModule.showFullScreen at argument index 1)
Update: I fixed the problem and working perfectly by setting currentTime:event.duration to currentTime:event.currentTime
@Gabsys issue 2nd and 3rd are now fixed. do event has currentTime property?
@dip77 Yes ~
one need to update index.js file in video player
onToggleFullScreen() { if(Platform.OS === "android") { var uri = this.props.video.uri; *NativeModules.BridgeModule.showFullscreen(uri,this.state.currentTime1000);//passing MS as duration** //currentTime is stored in state and changes whenever onProgress gets called } else { this.player.presentFullscreenPlayer(); }
onProgress(event){ this.setState({ currentTime:event.duration }) }