【文件属性】:
文件名称:nativescript-headset-detection:检测何时(断开)连接了耳机(插Kong或蓝牙)
文件大小:47.98MB
文件格式:ZIP
更新时间:2021-02-04 09:50:05
headset bluetooth headphones nativescript nativescript-plugin
NativeScript耳机检测插件
安装
tns plugin add nativescript-headset-detection
API
isConnected
要在任何给定时刻检查耳机,请使用以下方法:
JavaScript
var headsetDetection = require ( "nativescript-headset-detection" ) ;
headsetDetection . isConnected ( )
. then ( function ( connected ) { console . log ( "Connected? " + connec