运行在视频查看Android的奥飞动漫 [英] Run alpha animation on Video View android

查看:186
本文介绍了运行在视频查看Android的奥飞动漫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功添加VideoView在我的布局,我能够发挥它。我对videoview之上,点击某个按钮时,一个漂亮的动画标志。在同一时间,我想淡出视频。但在其上运行奥飞动漫immedietly把它变黑。我发现videoview没有表现得像一个普通的观点,因为它的表面观。我试图把它的框架布局里面,但没有奏效。动画看起来是这样的:

I've successfully added VideoView on my layout and I'm able to play it too. I have a nice animating logo on top of videoview, when certain button is clicked. In the same time I want to fade out the video. But running alpha animation on it immedietly turn it black. I found that videoview is not behaving like an ordinary view, because it's surface view. I tried putting it inside frame layout, but it didn't work. Animation looks like this:

AlphaAnimation alphaAnimation = new AlphaAnimation(1.0f, 0.0f);
alphaAnimation.setDuration(1000);
alphaAnimation.setFillAfter(true);

videoView.suspend(); //pause video
videoView.startAnimation(alphaAnimation);

所以,我怎么能淡出视频?

So how can I fade out video?

推荐答案

您不能动画 VideoView 。你为什么不尝试使用 TextureView ,其行为就像一个正常的查看。你可以找到如何在 TextureView 从这个答案播放视频在SO

You cannot animate VideoView. Why don't you try using TextureView, which behaves just like a normal View. You can find how to play video in TextureView from this answer in SO.

这篇关于运行在视频查看Android的奥飞动漫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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