package com.hc.lib.video;

import android.view.KeyEvent;

public class PlayerHelper {

    /**
     * 根据业务需求，判断用户按下的键值是否在需要拦截的键值名单中
     *
     * @param keyCode 按键值
     * @return <code>true</code>表示拦截
     */
    public static boolean shouldOverrideKeyEvent(int keyCode) {
        return keyCode == KeyEvent.KEYCODE_DPAD_LEFT || keyCode == KeyEvent.KEYCODE_DPAD_RIGHT
                || keyCode == KeyEvent.KEYCODE_DPAD_UP || keyCode == KeyEvent.KEYCODE_DPAD_DOWN
                || keyCode == KeyEvent.KEYCODE_DPAD_CENTER || keyCode == KeyEvent.KEYCODE_ENTER
                || keyCode == KeyEvent.KEYCODE_BACK;
    }
}
