Giter VIP home page Giter VIP logo

Comments (4)

A-ANing avatar A-ANing commented on June 19, 2024

视频放到scrollview中的吗?

是否一个滚动列表里面只有一个视频,而且视频在scrollview的顶部,是的话 你完全可以把视频放到 scrollview外面;

如果真的要scrollview嵌套视频,你可以在全屏的时候通过全屏回调将scrollview的滚动禁用掉,scrollview有个scrollEnabled属性

from react-native-rn-videoplayer.

zhenghao-z avatar zhenghao-z commented on June 19, 2024

感谢老哥,我真的是个菜鸡,全屏回调禁用后可以手势滑动。

不过有一个疑问
我测试了几台手机,这个手势是需要短暂长按(手指短暂停留后)滑动后才能触发,
可能是习惯了b站的手势,b站是接触到屏幕,不需要这个短暂停留的过程即可触发。

from react-native-rn-videoplayer.

A-ANing avatar A-ANing commented on June 19, 2024

我这边没出现这种情况,只要手指滑动就会触发,试试关闭dubug模式;

看看我这边的效果 国内关闭vpn

这是我的代码

import React, { Component } from 'react';
import {
    Text,
    View,
    ScrollView,
    Dimensions,
    StyleSheet
} from 'react-native';
import VideoPlayer from 'react-native-rn-videoplayer';
const { width } = Dimensions.get('window');

export default class Demo extends Component {
    state = {
        scrollEnabled: true
    }

    onWindowChange=(e)=>{
        this.setState({scrollEnabled:e=="full"?false:true})
    }

    render() {
       const {scrollEnabled}=this.state

        return (
            <ScrollView style={{ backgroundColor: "#fff" }} scrollEnabled={scrollEnabled}>

                <VideoPlayer
                    url={"http://xudaxianer.cn/video/6433a393957412d24852d669ee91d829.mp4"}
                    autoPlay={true}
                    ref={(ref) => this.player = ref}
                    lockControl={true}//控件锁定功能 v2.0.6增加
                    moreSetting={() => null}//右上角更多按钮 输出null则不显示
                    onWindowChange={this.onWindowChange}
                />

                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>
                <View style={styles.View}><Text>其他view</Text></View>

            </ScrollView>
        )
    }
}

const styles = StyleSheet.create({
    View: { width: width, backgroundColor: "pink", marginVertical: 50,paddingVertical:20,alignItems:'center' },
})

from react-native-rn-videoplayer.

A-ANing avatar A-ANing commented on June 19, 2024

需要更多信息 或者提供代码

from react-native-rn-videoplayer.

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.