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