滚动视图中的 Android::VideoView [英] Android::VideoView inside a ScrollView

查看:41
本文介绍了滚动视图中的 Android::VideoView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个位于滚动视图中的 VideoView.当我滚动 scrollView 时,VideoView 不会随之滚动.就好像它的位置是固定的.如何通过滚动 scrollView 中的所有其他元素正确滚动 VideoView?

I have a VideoView that is inside a scrollView. When I scroll the scrollView, the VideoView does not scroll with it. It is like its position is fixed. How can I scroll the VideoView correctly with the scrolling of all other elements in the scrollView?

推荐答案

显示通常分为两个管道

  • 帧缓冲管道 - 这是显示所有图形的地方.所有 UI 显示元素都进入此管道
  • 视频缓冲区管道 - 这是您的视频数据被转移到的地方.

现在,当你声明一个表面视图时,你会在 UI 中占用一些屏幕空间,说这是视频的显示位置.因此所有其他 UI 元素将无法占用该空间.

Now when you declare a surface view you take up some screen space in the UI saying this is where the video will be displayed. So all other UI elements will not be able to occupy that space.

当滚动发生时,你的表面视图确实会根据滚动事件向上或向下移动,但问题是视频缓冲区管道不关心帧缓冲区管道中发生了什么,它会继续将视频数据填充到空间中在其中初始化.

When scrolling happens your surface view will indeed be moved up or down depending on the scroll event but the problem is the video buffer pipeline does not care what happens in the frame buffer pipeline it goes on filling up the video data into the space in which it was initialised with.

所以到目前为止,您无法在 android 中滚动视频..

So as of now you cannot scroll the video in android..

这篇关于滚动视图中的 Android::VideoView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆