安卓VideoView起2视频的同时 [英] Android VideoView plays 2 videos at the same time

查看:131
本文介绍了安卓VideoView起2视频的同时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打一个 videoview 在另一个视频查看上面。第一视频认为暂停,而第二个被打。这似乎是工作,但没有秒的视频出现在屏幕上(虽然我听到声音,看,通常会出现在顶部的控制)。我假定这是某种形式的顺序问题。有什么想法吗。顺便说一句,我没有问题,显示其它视图在主视频查看的顶部,并具有视频填充背景。

I am trying to play a videoview on top of another video view. The first video view is paused, while the second is playing. It appears to work but no second video appears on the screen (though I hear the audio and see the controls that would normally appear on top). I am assuming this is some sort of order issue. Any thoughts. By the way, I have no problem displaying other views on top of the main video view and having the video fill the background.

推荐答案

这是行不通的 - 的VideoView特别是在某种意义上说,它拳正常视图一个洞允许直接访问显示像素(或者,在机器人方面,面 - VideoView是SurfaceView的一个子类)。你不能叠加两种SurfaceViews上海誓山盟的顶部 - 第一个抓住像素(表面)将拥有它。 (见SurfaceHolder.Callback.surfaceCreated()/ surfaceDestroyed())

That won't work - the VideoView is special in the sense that it 'punches' a hole in the normal Views to allow direct access to the display pixels (or, in android terms, the 'Surface' - VideoView is a subclass of SurfaceView). You cannot layer two SurfaceViews on top of eachother - the first one that grabs the pixels (the Surface) will 'own' it. (see SurfaceHolder.Callback.surfaceCreated() / surfaceDestroyed())

在SurfaceView之上的其他意见的执行的工作,因为该框架将构成正常观看显示位在表面的顶部。它不能做到这一点与其它VideoView(即SurfaceView),因为没有什么组成。

Other Views on top of a SurfaceView do work, because the framework will compose the display bits of normal Views on top of the Surface. It cannot do that with another VideoView (i.e. a SurfaceView) because there is nothing to compose.

这篇关于安卓VideoView起2视频的同时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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