SurfaceHolder.setType是德precated ......但要求? [英] SurfaceHolder.setType is deprecated... But required?

查看:630
本文介绍了SurfaceHolder.setType是德precated ......但要求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无效android.view.SurfaceHolder.setType(整型)

void android.view.SurfaceHolder.setType(int type)

公共抽象无效的setType(整型)自:API级别1

public abstract void setType (int type) Since: API Level 1

此方法去precated。此被忽略,此值被设置   在需要时自动。

This method is deprecated. this is ignored, this value is set automatically when needed.

设定表面的类型。

<一个href="http://developer.android.com/reference/android/view/SurfaceHolder.html">http://developer.android.com/reference/android/view/SurfaceHolder.html

它说,它会自动设置,但是,没有它我不能播放视频。发生了什么?有东西取代它?我有一个时间让视频在Android上正常播放。

It says it's set automatically but, without it my video doesn't play. What's going on here? Is there something that replaces it? I'm having a time getting video to play correctly on Android.

推荐答案

诀窍是知道什么时候的是pcated德$ P $,这是一种很难确定从我的经验的。文档始终是最新的可用最新的API,但是你可能没有最新的API上运行这个程序,如果我不得不猜测。所以,你还是要使用此方法(通常与PUSH_BUFFERS),使其工作在旧的平台。

The trick is in knowing when it was deprecated, which is kind of hard to determine from my experience. The documentation is always current for the latest API available, but you are probably not running this app on the latest API, if I had to guess. So you still have to use this method (typically with PUSH_BUFFERS) to make it work on older platforms.

编辑:这是pcated中的Andr​​oid 3.0,该文档反映,现在去$ P $
因此,我们可以使用它像以下内容:

it was deprecated in Android 3.0, which the docs now reflect.
So we can use it like following:

if(Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB)
    getHolder().setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);

这篇关于SurfaceHolder.setType是德precated ......但要求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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