Giter Site home page Giter Site logo

Comments (14)

uribro avatar uribro commented on July 23, 2024 45

I achieve it with this code, hope it helps:

import {ActivityIndicator} from 'react-native';

constructor(props) {
    super(props);
    this.state = {opacity: 0};
}

 onLoadStart = () => {
    this.setState({opacity: 1});
}

onLoad = () => {
    this.setState({opacity: 0});
}

onBuffer = ({isBuffering}) => {
    this.setState({opacity: isBuffering ? 1 : 0});
}

render() {
    return (
        <View style={styles.container}>
            <Video
                onBuffer={this.onBuffer}
                onLoadStart={this.onLoadStart}
                onLoad={this.onLoad}
            />
              <ActivityIndicator
                animating
                size="large"
                color={Colors.Pink}
                style={[styles.activityIndicator, {opacity: this.state.opacity}]}
            />
        </View>
    );
}
styles.activityIndicator: {
        position: 'absolute',
        top: 70,
        left: 70,
        right: 70,
        height: 50,
    },

opacity is used instead of isLoading state due to react native bug see:
https://stackoverflow.com/questions/38579665/reactnative-activityindicator-not-showing-when-animating-property-initiate-false

from react-native-video-player.

 avatar commented on July 23, 2024 3

It's been more than 2 years.
Any update on this?

from react-native-video-player.

cornedor avatar cornedor commented on July 23, 2024

That is currently not possible, I'll try to add it soon.

from react-native-video-player.

isAlmogK avatar isAlmogK commented on July 23, 2024

+1

from react-native-video-player.

bisht2ankit avatar bisht2ankit commented on July 23, 2024

Same issue

from react-native-video-player.

miladnit avatar miladnit commented on July 23, 2024

+1

from react-native-video-player.

JP6720 avatar JP6720 commented on July 23, 2024

How to show when video is in List. I want to show buffering on every video.

from react-native-video-player.

JP6720 avatar JP6720 commented on July 23, 2024

How to use this all methods for all videos when videos in Flatlist.
Because mostly state can use for single component only.

from react-native-video-player.

max-kim avatar max-kim commented on July 23, 2024

How to use this all methods for all videos when videos in Flatlist.
Because mostly state can use for single component only.

You can isolate all of items to dedicated component with its own state

from react-native-video-player.

mallikarjuna-sharma avatar mallikarjuna-sharma commented on July 23, 2024

+1

from react-native-video-player.

AtaMuhiuldin avatar AtaMuhiuldin commented on July 23, 2024

@uribro thanks, you solution worked for me as well!

from react-native-video-player.

fukemy avatar fukemy commented on July 23, 2024

@uribro I can click to play video after set position 'absolute' of indicator

from react-native-video-player.

sumitmitra255 avatar sumitmitra255 commented on July 23, 2024

Hello thank you all for this post and the replies. I have achecived a really good buffering indicator.

from react-native-video-player.

tanzeel-abdulWahid avatar tanzeel-abdulWahid commented on July 23, 2024

There is a default loader when video is played. How can we hide that?

from react-native-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.