Code Monkey home page Code Monkey logo

Comments (9)

abbasfreestyle avatar abbasfreestyle commented on July 29, 2024 1

Hi @guilharj,

Thanks for the PR. I agree. I think that's the best approach for now. I haven't really tested this with live streaming, so if it's all working as expected that's awesome :)

I'll close this as soon as it's merged.

from react-native-af-video-player.

abbasfreestyle avatar abbasfreestyle commented on July 29, 2024 1

@guilharj Added your fix in 0.1.4 👍

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

I think that I've figured out how where is the problem. And appears to be the react-native-slider library. After a deep deep deep debuging of the UIManager.

the Slider.js file has a definition like this:
<Animated.View onLayout={this._measureThumb} renderToHardwareTextureAndroid={true} style={[ {backgroundColor: thumbTintColor}, mainStyles.thumb, thumbStyle, { transform: [ { translateX: thumbLeft }, { translateY: 0 } ], ...valueVisibleStyle } ]} > {this._renderThumbImage()} </Animated.View>

The problem is in the transform style. The Xcode debug console said "Error setting property 'transform' of RCTView with tag #360: Exception thrown while executing UI block: -[NSNull floatValue]: unrecognized selector sent to instance 0x107793ef0"

if I remove this transformation, the code works fine. If anyone with more knowledge of this lib knows the reason, will help a lot. I will still work on this.

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

UPDATE. I think that the slider needs parameters like minimum and maximum value to the slider. BUT, I'm using a live streaming and this could be tricky.

var thumbLeft = value.interpolate({
inputRange: [minimumValue, maximumValue],
outputRange: [0, containerSize.width - thumbSize.width],
//extrapolate: 'clamp',
});

A Idea to solve this, is deal with live streams at the video control in a different way of common video. What about not using the slider on live streams?

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

So, bc the livestream, the progress ins Infinity. So what about this idea?

<View style={styles.container}>
      { Platform.OS === 'ios' ?
        <Slider
          onValueChange={val => props.onSeek(val)}
          onSlidingComplete={val => props.onSeekRelease(val)}
          value={progress === Number.POSITIVE_INFINITY ? 0: progress}
          thumbTintColor={theme}
          thumbStyle={thumbStyle}
          trackStyle={trackStyle}
          minimumTrackTintColor={theme}
          maximumTrackTintColor={trackColor}
        />

Note this change
value={progress === Number.POSITIVE_INFINITY ? 0: progress}

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

@abbasfreestyle What you think?

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

guilharj@e0ed9b8

Feel free to merge. BYe BYe

from react-native-af-video-player.

guilharj avatar guilharj commented on July 29, 2024

Another Way, is not showing the slider, and show a label like "Live Broardcast" The Macos player used on safari do something like this :)

from react-native-af-video-player.

abbasfreestyle avatar abbasfreestyle commented on July 29, 2024

Sounds like a good idea. I may consider this for the future. For now the original solution is good enough :)

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.