Coder Social home page Coder Social logo

Comments (3)

abbasfreestyle avatar abbasfreestyle commented on July 4, 2024

Hi @limaeduardo,

Thanks for the kind words :)
To give you a bit of context to seek(), the value is actually the slider percentage. so you'd need to convert that into seconds, which is why you see val * this.state.duration i'll rename it to percent * this.state.duration in the next release.

I haven't actually tested controlling seek from outside. But if you covert the seconds into percentage, in theory it should work. You'd need the duration in order to work out the percentage. To do that you can access the the duration with onLoad.

e.g

<Video 
    url={props.video.signedUrl}
    title={props.video.title}
    ref={(ref) => {this.video = ref}}
    onFullScreen={status => this.onFullScreen(status)}
    onLoad={(data) => this.setState({ duration: data.duration })
    rotateToFullScreen
/>

<Button onPress={() => this.video.onSeekRelease(20 / this.state.duration)}> seek </Button>

I hope this solves your issue. I'll add better seek control in the next version without having to calculate the percentage, something like seekTo(seconds).

from react-native-af-video-player.

abbasfreestyle avatar abbasfreestyle commented on July 4, 2024

@limaeduardo I've added seekTo(seconds) in version 0.2.0 👍

from react-native-af-video-player.

eduflm avatar eduflm commented on July 4, 2024

It's working just fine! Thanks 😄

from react-native-af-video-player.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.