zoukankan      html  css  js  c++  java
  • 在FlashCom中检测摄像头和麦克风的方法

    经常在flashcomguru中发现好东西,今天觉得这个挺有用的
    01 : //检查摄像头
    02 : function CheckForCam() {
    03 : camArray = Camera.names;
    04 : if (camArray.length >= 1){
    05 : temp_cam = Camera.get();
    06 : if(temp_cam == -1) {
    07 : trace('--- cam is detected but its busy');
    08 : return -1; }
    09 : else {
    10 : trace('--- cam detected');
    11 : return 1; }
    12 : delete temp_cam;
    13 : } else if (camArray.length == 0) {
    14 : trace('--- no cam detected');
    15 : return 0;
    16 : }
    17 : }
    18 :
    19 :
    20 : // 检查麦克风
    21 : function CheckForMic() {
    22 : micArray = Microphone.names;;
    23 : if (micArray.length >= 1){
    24 : temp_mic = Microphone.get();
    25 : if(temp_mic == -1) {
    26 : trace('--- mic is detected but its busy');
    27 : return -1; }
    28 : else {
    29 : trace('--- mic detected');
    30 : return 1; }
    31 : delete temp_mic;
    32 : } else if (micArray.length == 0) {
    33 : trace('--- no Mic detected');
    34 : return 0;
    35 : }
    36 : }
  • 相关阅读:
    hashlib模块
    logging模块
    Python的富比较方法
    格式化符号说明
    __str__与__repr__区别
    2014-07-18 10:25

    2014-07-17 17:04
    2014-07-17 16:44
    2014-07-16 15:54
  • 原文地址:https://www.cnblogs.com/top5/p/1615744.html
Copyright © 2011-2022 走看看