Comments (20)
你看看我的文档 最上面有写这个问题,就是视频没居中的那个问题。
from react-native-rn-videoplayer.
react-native-video/react-native-video#2046
from react-native-rn-videoplayer.
感谢回复。这个问题已经解决了。还有一个问题,我昨天看了半天没解决。就是视频从全屏恢复到小屏幕会导致 状态栏颜色发生变化。或者 底部 虚拟 按键直接消失了
from react-native-rn-videoplayer.
有gif吗
from react-native-rn-videoplayer.
录了个视频,你帮忙看看 https://cowtransfer.com/s/d453d0bbf5304c
from react-native-rn-videoplayer.
我发现你首次进入小窗口播放的时候,隐藏了状态栏是吧,然后全屏切换到小屏后(默认的返回小屏会展示状态栏)显示了状态栏白底黑字。
首先这个我这边默认的是小窗口状态栏是:显示,黑底白字,因为有些安卓手机又刘海。挖孔屏等。
以上的问题你得看你的需求来改代码了。
再就是我看到你返回小屏底部手机的功能键隐藏了,是通过你app主页的视频(主页视频不是用的这个)直接点击的全屏,我不知道你这个中间的代码是什么,干了什么,是怎么直接从主页的视频直接到全屏播放的。
from react-native-rn-videoplayer.
是的。进入小窗口播放隐藏了状态栏。那估计是返回的时候状态栏有显示了导致的。 主页的视频列表是用我自己用video组件做的。然后给了一个点击事件 调用 this.player.changeWindows(true); 跳转到你这个组件来实现全屏播放的。列表内的视频感觉全屏不好做
from react-native-rn-videoplayer.
如果要改 默认小屏状态栏的颜色 需要改哪里的代码
from react-native-rn-videoplayer.
我能看看主页直接到全屏的代码吗。
from react-native-rn-videoplayer.
全屏的代码
import React from 'react';
import {View, StatusBar} from 'react-native';
import BaseComponent from '../base/BaseComponent';
import Video from 'react-native-rn-videoplayer';
export default class VideoFullScreenPage extends BaseComponent {
constructor(props) {
super(props);
this.state = {
uri: this.props.navigation.getParam('uri', ''),
title: this.props.navigation.getParam('title', ''),
duration: this.props.navigation.getParam('duration', 0), //时间
currentTime: this.props.navigation.getParam('currentTime', 0), //当前时间
videoPoster: this.props.navigation.getParam('videoPoster', null) //当前时间
};
}
componentDidMount() {
this.player.changeWindows(true);
}
renderContent() {
return (
<Video
navigation={this.props.navigation}
goBack={() => this.props.navigation.goBack()}
onSmallBack={() => this.props.navigation.goBack()}
storeComponent={() => null}
continuous={false}
moreSetting={() => null}
ref={(ref) => (this.player = ref)}
poster={this.state.videoPoster}
url={this.state.uri}
/>
);
}
}
from react-native-rn-videoplayer.
主页直接调用 this.props.navigation.push 传参跳转进来的。没做其他操作
from react-native-rn-videoplayer.
如果要改 默认小屏状态栏的颜色 需要改哪里的代码
/view/index.js的Header组件 return 一个null 或者空view都行
然后看你要不要隐藏状态栏切换到小屏的根index.js的 setSmall 方法中 注释 StatusBar.setHidden(false);
from react-native-rn-videoplayer.
收到 我测试下给你答复
from react-native-rn-videoplayer.
好的 谢谢
from react-native-rn-videoplayer.
我知道问题啦。你fork后你那边自己定义了一个goBack()方法, 你的goBack没有写还原手机底部功能按钮哦,你得在goBack内修改成如下
if (typeof this.props.goBack === 'function') {
Platform.OS === 'android' && NativeModules.HideBottomNa.show();//这行
this.props.goBack();
}
或者在componentWillUnmount里面。
因为我没有考虑全屏直接返回上个页面;我这边如下(感谢兄台分享的网站):
https://imgchr.com/i/az4JKg
from react-native-rn-videoplayer.
好的,非常感谢。我这边不知道为啥 全屏切换到小屏后状态栏总是显示白底白字。我也没有设置这也颜色(手动摊手)
from react-native-rn-videoplayer.
好的,非常感谢。我这边不知道为啥 全屏切换到小屏后状态栏总是显示白底白字。我也没有设置这也颜色(手动摊手)
如果返回还是白底黑字,那你在返回后代码里面手动StatusBar.setHidden(true);一下,因为我java代码NativeModules.HideBottomNa.show()会显示状态栏; 哈哈哈哈,所以不太符合你这边的需求,你得返回后手动StatusBar.setHidden(true);
from react-native-rn-videoplayer.
加个微信否? xn839650216
from react-native-rn-videoplayer.
谢谢。已添加
from react-native-rn-videoplayer.
谢谢。已添加
from react-native-rn-videoplayer.
Related Issues (20)
- 如果能在加个播放速率,那就简直完美了 HOT 8
- 在安卓下有bug,播放时的视频尺寸不对 HOT 5
- 发现个致命问题,这串代码在render里执行 HOT 2
- 全屏后,无法退出全屏 HOT 1
- 可以支持视频列表吗 HOT 9
- Could not resolve com.android.tools.build:gradle:3.3.1 HOT 1
- android 视频关闭后,状态栏背景颜色会变白色 HOT 9
- IOS 报错 Invariant Violation: Native module cannot be null. HOT 4
- 需要列出依赖了哪些第三方库
- null is not an object (evaluating 'event.nativeEvent.pageX)
- android react-native 0.63.2 react-native-rn-videoplayer 2.2.10
- 拖动进度条崩溃,有人遇到么还是我环境没有好? HOT 4
- react-native-orientation-lock编译一直出错 HOT 1
- CONFIGURING一直卡60 HOT 3
- install进来之后按照文档配置完,开始run发现卡死在这里 HOT 8
- 无法配置控件宽高,resizeMode写死了none后在有点设备下视频内容无法完整显示
- Getting console warnings
- is:issue is:open 当全屏播放时候,左上角的“<”返回按钮退出不了 全屏,也后退不了,是否可以加一个OnBigBack的回调呢?或许自动退出全屏 HOT 8
- Full screen Landscape issue
- need update for react native 0.73.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-rn-videoplayer.