视频周围出现绿色边框

发布于 2025-01-12 22:22:04 字数 1687 浏览 2 评论 0原文

我在我的视频应用程序中使用 react-native-video 。大多数视频都按预期工作。但对于某些视频,视频周围会出现绿色边框。我不知道它来自哪里。有人可以帮我解决这个问题吗?

绿色边框

请检查下面的源代码

                     <View style={{
                        width:  160,
                        height:  270,
                        justifyContent:"center", 
                        alignItems: 'center',
                    }} >
                        
                        <Video
                            ref={(ref) => {
                                Player = ref
                       
                            }}
                            source={source}
                            ignoreSilentSwitch="ignore"
                            key={"key"+keyVal.toString()}
                           
                            style={{
                                width: 160,
                                height: 270,

                            }}
                            muted={false}
                            volume={1.0}
                          
                            resizeMode= {"contain"}
                            paused={isPaused}
                            onError={(error) => {
                            }}
                           
                            onReadyForDisplay={() => {

                            }}
                          
                            playInBackground={false}
                            playWhenInactive={false}
                        />

                    </View>

I am using react-native-video in my app for videos. Most of the videos are working as expected. But for some videos, a green border is appearing around the video.I don't know from where it is coming. Can someone please help me with this?

Green Border

Please check below source code

                     <View style={{
                        width:  160,
                        height:  270,
                        justifyContent:"center", 
                        alignItems: 'center',
                    }} >
                        
                        <Video
                            ref={(ref) => {
                                Player = ref
                       
                            }}
                            source={source}
                            ignoreSilentSwitch="ignore"
                            key={"key"+keyVal.toString()}
                           
                            style={{
                                width: 160,
                                height: 270,

                            }}
                            muted={false}
                            volume={1.0}
                          
                            resizeMode= {"contain"}
                            paused={isPaused}
                            onError={(error) => {
                            }}
                           
                            onReadyForDisplay={() => {

                            }}
                          
                            playInBackground={false}
                            playWhenInactive={false}
                        />

                    </View>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉城 2025-01-19 22:22:04

这可能是指你的视频风格。首先更改您的 video 组件样式,如下所示:

  style={{
            width: "100%",
            height: "100%",
         }}

如果不起作用,您可以更改 video 组件的 resizeMode ,例如 stretch

it's maybe refer to your video style . at first change your video component style like this :

  style={{
            width: "100%",
            height: "100%",
         }}

if not work , you can change resizeMode of video component like stretch

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文